下面是我的侧边栏的HTML和CSS代码。背景图片不会显示
<div id="sidebar">
<header>
<h3 class="site-title">The Code Stitchery</h3>
</header>
<nav>
<ul>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
CSS
nav a {
background: url(/Images/tape_measure_unit.png) no-repeat;
display: block;
padding: 2px 4px;
text-align: center;
width: 256px;
height: 36px;
}
的背景图像显示在Eclipse的网页编辑器就好了,但是当我走在Web浏览器中打开同一个页面,只有文字显示。 我从一些其他职位试过的建议,其中包括:
- Background Image won't show up in CSS unless I load an image using the <img> tag in HTML
- Background images not appearing
- Background image wont show up
但我仍然难住了。
这是侧边栏看起来像Eclipse的网页编辑器是什么:
这就是它看起来像在Mozilla Firefox:
用于获取图像的正确显示任何提示吗?
如果您将“图片”全部设为小写,会发生什么情况? – Scott 2012-03-15 01:42:59
最有可能不会工作 – MissPiplup 2012-03-15 08:16:12