那位大神指點(diǎn)一下?基本和例題一樣,為什么圖片顯示不出來(lái)呢?萬(wàn)分感謝
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無(wú)標(biāo)題文檔</title>
<style>
*{margin:0;padding:0;}
h3{margin:0;padding:0;display:block;}
ul{list-style:none;}
li h3{font-size:14px;font-weight:400}
li{
display:block;
height:31px;
line-height:31px;
overflow:hidden;
border-bottom:1px solid #333;
position:relative;
z-index:2;
vertical-align:bottom;
margin;1px 10px o;
}
li i{
display:inline;
width:30px;
height;24px;
float:left;
margin:3px 10px 0 0;
}
.cat{
position:relative;
width:150px;
background:#f3f3f3;
border:1px solid #999}
.cat i{background:url(http://img1.sycdn.imooc.com//539a950e00015ba500710200.jpg);}
.cat1 i{background-position:0 0;}
.cat2 i{background-position:0 -24px;}
.cat3 i{background-position:0 -48px;}
.cat4 i{background-position:0 -72px;}
.cat5 i{background-position:0 -96px;}
</style>
</head>
<body>
<div class="cat">
? ? <ul>
? ? ? ? <li class="cat-1">
? ? ? ? <i></i>
? ? ? ? <h3>服裝內(nèi)衣</h3>
? ? ? ? </li>
? ? ? ? <li class="cat-2">
? ? ? ? <i></i>
? ? ? ? <h3>鞋包配飾</h3>
? ? ? ? </li>
? ? ? ? <li class="cat-3">
? ? ? ? <i></i>
? ? ? ? <h3>運(yùn)動(dòng)戶外</h3>
? ? ? ? </li>
? ? ? ? <li class="cat-4">
? ? ? ? <i></i>
? ? ? ? <h3>珠寶手表</h3>
? ? ? ? </li>
? ? ? ? <li class="cat-5">
? ? ? ? <i></i>
? ? ? ? <h3>手機(jī)數(shù)碼</h3>
? ? ? ? </li>
? ? </ul>
</div>
</body>
</html>
2015-08-07
把.cat i{background:url(http://img1.sycdn.imooc.com//539a950e00015ba500710200.jpg);}刪除,然后把background加到.cat去
2015-09-08
不是一個(gè)加到????.li i ?中嗎
2015-08-10
你前后的名稱不一樣。一個(gè)是cat-1,一個(gè)是cat1。.cat中少了-!
2015-08-10
我也是用.cat i添加的background。能顯示圖片啊。我看到咱兩的代碼一樣,為什么你顯示不出來(lái)
2015-08-07
margin;1px?10px?o;?????
2015-08-07
2015-08-07
把.cat i{background:url(http://img1.sycdn.imooc.com//539a950e00015ba500710200.jpg);}刪除,然后加到background加到.cat去