【发布时间】:2016-11-16 06:00:43
【问题描述】:
我正在尝试使用 css sprite 在图像的特定部分上移动一段文本。但我应用的背景位置似乎不起作用。我尝试更改背景位置,但文本部分(即 twitter、facebook)没有移动到正确的位置。
#fixedsocial {
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 {
cursor: pointer;
}
.twitterflat {
height:50px;
background-position: -400px 0;
}
.twitterflat:hover {
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>
【问题讨论】:
-
其实我没有理解你的要求。
-
我想显示第二排圆圈上的 Facebook 和 Twitter 图标
-
"我想显示 Facebook 和 Twitter 图标,它出现在第二排圆圈一" 这是什么意思?
-
我上传的那张图片
-
从那张图片中我想显示 facebook 和 twitter 图片 - 第二个 raw 上的圆圈图标