我正在嘗試使用CSS sprites移動圖像的特定部分上的一段文字。但我應用的背景位置似乎不起作用。我試圖改變背景位置,但文本部分(即twitter,臉書)不移動到正確的位置。 如何正確使用css sprite?
#fixedsocial {
\t background:url("../img/socials/icon.png") no-repeat;
top:40%;
width:50px;
height: 100px;
position:fixed;
left: 0;
display: block;
z-index: 1000;
background-color: #eee;
text-indent:-9999px;
}
.facebookflat {
background-position: -200px 0;
height:50px;
}
.facebookflat:hover {
\t cursor: pointer;
}
.twitterflat {
\t height:50px;
\t background-position: -400px 0;
}
.twitterflat:hover {
\t cursor: pointer;
}
<div id="fixedsocial">
<div class="facebookflat" id="shareBtn"></div>
<div class="twitterflat"> <a href="https://twitter.com/share" data-show-count="false"></a> </div>
</div>
其實我不明白您的要求。 – ketan
我想顯示出現在第二排圓圈上的Facebook和Twitter圖標 –
「**我想要顯示在第二排圓圈上出現的Facebook和Twitter圖標**」這是什麼意思? – ketan