我有一个 200px x 100px 的图像,它充当链接的背景图像。悬停时,背景图像会发生变化。
在这里小提琴:http: //jsfiddle.net/EnsFK/
从图片可以看出,文字与图片没有对齐,出现在底部。有没有办法对齐文本,使其位于中间(与小点对齐?)我尝试了垂直对齐和行高,但无济于事。
.current-location {
line-height: 24px;
background-size: 48px 24px;
height: 24px;
width: 24px;
text-decoration: none;
position: relative;
line-height: 24px;
vertical-align: middle;
}
.current-location span {
background: url(images/mobile/current-location.gif) left top no-repeat;
display: inline-block;
background-position: 0px 0px;
background-size: 48px 24px;
height: 24px;
width: 24px;
margin-right: 10px;
}
.current-location:hover span {
display: inline-block;
background-position: -24px 0px;
background-size: 48px 24px;
height: 24px;
width: 24px;
}