我给了它一个宽度/高度;路径相对于 CSS 应该是正确的。这是一个很大的 div,包含一些其他的,我不知道这是否相关,所以我也将它们复制了进去。
HTML:
<div id="fenster">
<div id="links">
<img src="logo.gif" height="220" width="260">
<div id="menu">
...
</div>
<div id="social">
...
</div>
</div>
</div>
CSS:
#fenster {
background-image: "hintergrund.jpg";
top:0px;
left:0px;
background-repeat: repeat-x;
height: 700px;
width: 1200px;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
}
最佳答案
您的 background-image
属性没有有效值。您需要像这样将图像路径与 url
放在一起。
background-image: url("hintergrund.jpg");
关于CSS:Div 背景不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29253576/