:before擬似要素を使用して、アンカーテキストがリストに表示される前にロゴを表示し始めました。css:IE8で擬似要素が背景画像を表示しない前
私はニコラスギャラガーの指示に従っていますが、背景画像はIE8では表示されません。他のブラウザでも動作します。誰かが私が間違っているかもしれないものを見て?
私はここに例を掲載しました:ここ http://vervedesignstudios.com/gb/testBefore.html
は、マークアップは次のとおりです。あなたのアドバイスを事前に感謝し 。
<style>
/* Pseudo-element cropping bit */
.iLst24 li a:before {
content:"";
float:left;
width:24px;
height:24px;
margin:0 6px 0 0;
background-image:url("images/HomeSprite.png");
}
.iLst24 .fb a:before {background-position:0 0;}
.iLst24 .tw a:before {background-position:0 -50px;}
.iLst24 .yt a:before {background-position:0 -100px;}
</style>
<div class="iLst24">
<ul>
<li class="fb"><a href="http://www.facebook.com">Facebook</a></li>
<li class="tw"><a href="http://www.facebook.com">Twitter</a></li>
<li class="yt"><a href="http://www.facebook.com">YouTube</a></li>
</ul>
</div>
IE8、デモ、[this one](http://jsfiddle.net/7fSv6/)で完全にうまく動いています... –
Thanks Wesley。 IEは互換モードにも設定されていましたが、私は気づいていませんでした。 – MacGirl1985