我在使用background-position
.. 时遇到了一个奇怪的问题。它根本不起作用!
这是我的代码:
<div id="follow-wrapper">
<p>Follow Us</p>
<ul>
<li><a href="#" id="facebook-img"></a></li>
<li><a href="#" id="twitter-img"></a></li>
<li><a href="#" id="googlplus-img"></a></li>
<li><a href="#" id="linkedin-img"></a></li>
<li><a href="#" id="youtube-img"></a></li>
<li><a href="#" id="rss-img"></a></li>
</ul>
</div>
#follow-wrapper ul li {
display: inline-block;
margin-left:8px;
width: 16px;
height: 16px;
background-image: url('../img/follow.png');
background-repeat: no-repeat;
}
#facebook-img{
background-position: 0px 0px;
}
#twitter-img {
background-position: 0px -26px;
}
#googleplus-img{
background-position: 0px -52px;
}
#linkedin-img{
background-position: 0px -78px;
}
#youtube-img{
background-position: 0px -104px;
}
#rss-img{
background-position: 0px -130px;
}
结果如下: