目前我所有的 css Sprite 都是垂直对齐的,而且格式不正确。我将如何水平对齐它们?这是我的其中一个按钮的示例:
a.youtube {
background: url(images/icons.png) no-repeat 0 0;
height: 64px;
width: 64px;
display: block;
background-position: 0 -128px;
}
a.youtube:hover {
background-position: -64px -128px;
}
我现在无法使用此方法将它们对齐到中心:
#social_cont {
text-align: center;
background: url(images/banners/banner1.jpg);
height: 254px;
}
和这个 html:
<div id="social">
<a class="facebook" href="http://facebook.com/projectstratos"></a><a class="twitter" href="http://twitter.com/projectstratos"></a>
</div>
最佳答案
你可以先看看这个:
如果它不适合你,手动定位:
关于css - 如何水平对齐 css Sprite ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5203939/