If you are still worried about opaque background text, I suggest you take a look. Of course IE6 I have given up, so do not say that do not use PNG8 pictures so IE6 under the effect, of course, you can also use filters. I do not recommend using filters. Because there may be other problems! (such as unable to click and so on) to do the front of the most fear is the bug, especially IE6. Fuck off, ie6!.
The core of this article is to use PNG32 transparent pictures to do the background and then tile the background on the line. This will not have the background transparent text is also transparent. This is super simple, you know!
The picture only needs to adjust the transparency.
The transparency of setting the picture to 20% in the PSD is saved as PNG.
(Avoid: Do not set the mode to grayscale.) It's going to turn into PNG8. And there is no transparency. )
The background is transparent and the text is opaque. Ha ha. IE 6 Fuck off! Support: Ie7.0+/ff3.0+/opera10+/chrome/safari. All tests are passed.
The effect chart is as follows:
The complete code is as follows:
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>ie7+ background transparent, text opaque super simple method </title>
<style>
p{margin:0;padding:0;}
. bg{width:280px;padding:5px;margin:10px 0 10px;}
. bg1{background: #000; color: #fff;}
. Bg2{background: #f60;}
. Com{background:url (Http://images/css_bg.png) repeat 0 0;border:1px solid #eee border-radius:5px;font-size:12px; padding:5px;line-height:20px;}
</style>
<body>
<div class= "bg bg1" >
<div class= "com" ><p> background transparent, text opaque. Ha ha. IE 6 fuck off! <br/> Support: <br/>ie7.0+/ff3.0+/opera10+/chrome/safari <br all tests passed. Transparency is:20%</p></div>
</div>
<div class= "bg Bg2" >
<div class= "com" ><p> background transparent, text opaque. Ha ha. IE 6 fuck off! <br/> Support: <br/>ie7.0+/ff3.0+/opera10+/chrome/safari <br all tests passed. Transparency is:20%</p></div>
</div>
</body>