爲什麼不能將我的精靈圖像顯示爲黃色邊框的背景? 這裏有一個例子:不會顯示雪碧圖像?
如果有人能來與我應該改變什麼一些例子,這將是偉大的..
只要讓我發佈媒體鏈接,需要在這個comapred到代碼的文本發佈-.-
這裏是我的代碼:
HTML:
<div class="repeat">
<div style='width:100%;'>
<div style='float:left;margin-top:107px;margin-left:50px;width:80px;height:100px;border:1px solid yellow;'>
<div class="menu">
<ul id='nav'>
<li class='front'><a href='?p=front'>Front</a></li>
</ul>
</div>
</div>
<div style='float:left;margin-top:107px;margin-left:10px;width:80px;height:100px;border:1px solid yellow;'></div>
<div style='clear:both;'></div>
</div>
</div>
個定製CSS:
.repeat {
float:left;
width: 884px;
height: auto;
min-height:700px;
background: url(images/repeat.png) repeat-y;
z-index:2;
}
.menu {
width:80px;
height:100px;
position:relative;
}
ul#nav {
list-style: none inside;
}
ul#nav li {
display: inline;
}
ul#nav li a {
display: block;
height: 40px;
float: left;
}
ul#nav li.front a{
width:80px;
background: url(images/menu/p1.png) top center no-repeat;
}
ul#nav li a:hover {
background-position: bottom center;
}
ul#nav li.front2 a{
width:80px;
background: url(images/menu/p1.png) bottom center no-repeat;
}
嘗試把絕對的而不是相對的URL放在'background:url('images/menu/p1.png')...' – dnagirl
你是什麼意思? o.O – Matthew
咦?黃色邊框沒有設置「背景圖像」。 – Nix