2013-01-24 32 views
1

我的同事寫了一些CSS來定位一個箭頭的小PNG的透明背景在圖像上。但是,他將它應用到錨標籤的後面:在僞元素之後。PNG 24位透明加載在IE8使用:在僞元素

這適用於除IE8以外的所有現代瀏覽器。他聲稱這是在IE8中工作,但我們都不知道爲什麼這不再起作用。

HTML

<html> 
<head> 
<title>IE8 PNG transparency test with :after</title> 
</head> 
<body> 
<div id="channel-feat-lists" class="feat-lists feat-stories is-invisible mod with-border"> 
<h4>TOP 3 STORIES</h4> 
<ul class="tout-stack"> 
<li id="c1" class="tout"> 
    <div class="tout-image size-160x165"><a href="#" class="video-link"><img src="http://img4.realsimple.com/images/home-organizing/decorating/0812/boy-tunnel-fort-ictcrop_160.jpg" 
       alt="#" 
       width="160" 
       height="165" /></a></div> 
    <h6><a href="#" class="has-number"><span class="tout-title-number">7 </span><span class="tout-title-remainder">Ideas for Kids' Forts</span></a></h6> 
    <div class="tout-dek">Want to create a fortress mighty enough to withstand any big bad wolf's huffs and puffs? Get inspired by these seven creations.</div> 
    <div class="tout-jump"><a class="jump">SEE MORE FUN VIDEOS</a></div> 
</li> 
<li id="c2" class="tout"> 
    <div class="tout-image size-160x165"><a href="#"><img src="http://img4.realsimple.com/images/home-organizing/decorating/0812/boy-tunnel-fort-ictcrop_160.jpg" 
       alt="#" 
       width="160" 
       height="165" /></a></div> 
    <h6><a href="#" class="has-number"><span class="tout-title-number">8 </span><span class="tout-title-remainder">Ideas for Kids' Forts</span></a></h6> 
    <div class="tout-dek">Want to create a fortress mighty enough to withstand any big bad wolf's huffs and puffs? Get inspired by these seven creations.</div> 
    <div class="tout-jump"><a class="jump" href="#">SEE MORE FUN VIDEOS</a></div> 
</li> 
<li id="c3" class="tout"> 
    <div class="tout-image size-160x165"><a href="#"><img src="http://img4.realsimple.com/images/home-organizing/decorating/0812/boy-tunnel-fort-ictcrop_160.jpg" 
       alt="#" 
       width="160" 
       height="165" /></a></div> 
    <h6 class="has-no-number"><a href="#">Example numberless title</a></h6> 
    <div class="tout-dek">Want to create a fortress mighty enough to withstand any big bad wolf's huffs and puffs? Get inspired by these seven creations.</div> 
    <div class="tout-jump"><a class="jump" href="#">SEE MORE FUN VIDEOS</a></div> 
</li> 
<li id="c4" class="tout"> 
    <div class="tout-image size-160x165"><a href="#"><img src="http://img4.realsimple.com/images/home-organizing/decorating/0812/boy-tunnel-fort-ictcrop_160.jpg" 
       alt="#" 
       width="160" 
       height="165" /></a></div> 
    <h6><a href="#" class="has-number"><span class="tout-title-number">8 </span><span class="tout-title-remainder">Ideas for Kids' Forts</span></a></h6> 
    <div class="tout-dek">Want to create a fortress mighty enough to withstand any big bad wolf's huffs and puffs? Get inspired by these seven creations.</div> 
    <div class="tout-jump"><a class="jump" href="#">SEE MORE FUN VIDEOS</a></div> 
</li> 
</ul> 
</div> 
</body> 
</html> 

CSS

.feat-lists .tout { min-height: 165px; margin-top: 14px; } 
.feat-lists .tout + .tout { border-top: 1px dotted #7f7f7f; padding-top: 14px; } 
.feat-lists .tout-image { float: left; margin-left: 7px; } 
.feat-lists .tout-image a { display: block; position: relative; } 
.feat-lists .video-link:after { background: transparent url('http://img4.realsimple.com/static/i/play-overlay.png') 0 0; content: ''; height: 24px; left: 70px; position: absolute; top: 70px; width: 19px; } 
.feat-lists h6 { margin-left: 181px; } 
.feat-lists h6 a { color: #333333; font: normal 1.8em Georgia, sans-serif; } 
.feat-lists h6 a.has-number:hover { text-decoration: none; } 
.feat-lists h6 a.has-number:hover .tout-title-remainder { text-decoration: underline; } 
.feat-lists .tout-title-number { color: #999999; display: block; font: normal 2.777em Georgia, sans-serif; margin-bottom: -4px; position: relative; top: -6px; } /* 2.777 x 1.8 = 5 = 50px */ 
.feat-lists .tout-dek { color: #666666; font: normal 1.3em Georgia, sans-serif; margin: 5px 0px 5px 181px; } 
.feat-lists .tout-jump { margin-left: 181px; } 
.feat-lists h6.has-no-number { padding: 2.5em 0 0 0; } 

這裏是的jsfiddle版本: http://jsfiddle.net/tangst/gByMb/

第一個圖像應該有覆蓋。

我試過PNG transparency prоblеm in IE8一些解決方案,但它們不起作用。

有沒有人遇到過這個?

回答

1

它不是PNG,它是IE8支持的問題:在僞元素之前/之後。

看一看這裏支持的瀏覽器的列表:http://css-tricks.com/browser-support-pseudo-elements/

顯然IE8有「部分支持」:

「z-index的不尊重,必須使用DOCTYPE,必須聲明:懸停狀態如果您使用:hover:之後/:懸停:之前「

+0

感謝您的鏈接。我們實際上並沒有使用:懸停:在這種情況下。疊加層位於鏈接上,無論它是否被徘徊。 – Stephen