これは実際には2 つの部分からなる質問です。私は理解できない2つの問題に苦しんでいます。
質問#1。スプライト イメージに両方のイメージが表示されるのはなぜですか。一番下が表示され、マウスオーバーで一番上が表示されると思います。表示されているもののスクリーンショットを投稿しました。以下は、私が使用している HTML と CSS スタイルの両方です。スプライト画像は 50x40 です。
HTML
<li>
<div class="image-wrapper">
<div class="image-options">
<a href="#" class="likeButton" title="Like image"><span>Like</span></a>
</div>
<a href="/view_profile.php?id=5693">
<img src="photos/files/5693/grid/e1cd6ee3042f35dc7a538a5e516507e3.jpeg" />
</a>
</div>
</li>
CSS:
.image-wrapper {
position : relative;
display : inline-block;
}
image-wrapper img {
position : relative;
}
.image-wrapper .image-options {
position : absolute;
top : 0;
right : 0;
left : 0;
height : 40px;
z-index : 2;
display : none;
background : #eeeeee;
zoom: 1;
filter: alpha(opacity=90);
opacity: 0.9;
}
.image-options .likeButton {
display: block;
width: 50px;
height: 40px;
border-right: 1px solid #dedede;
background: url('/bootstrap/img/like.png') bottom;
text-indent: -99999px;
}
.likeButton:hover {
background-position: 0 0;
}
質問#2。なぜ私のテキストは
お気に入り
現れる?スプライト画像の中央に表示しようとしています。
私が間違っているかもしれない考えはありますか?