下面是我的側邊欄的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