我在尝试重复图像标题时遇到了一个奇怪的 CSS 问题,由于某种原因它不起作用,这是代码,我做错了什么吗?
body {
background:url(images/bg.png) repeat 0% 0%;
font-family: 'Helvetica Neue', Arial, Verdana, sans-serif;
margin: 0;
padding: 0;
}
/* this part is not working its only showing the header in its original size I am trying to make it repeat*/
#header {
width: 100%;
background: url(header.png) repeat-x;
height:44px;
}
HTML:
<div id="wrap">
<div id="header">
</div>
</div>
最佳答案
这是你的道路。您的 header.png
是否与您的 CSS 文档位于同一路径?
如果不是,使用相对路径,例如:
width: 100%;
background: url(../header.png) repeat-x;
height:44px;
为图像所在的每个子文件夹添加一个 ../
。
关于html - 奇怪的 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5969121/