In newer browsers such as Ff/chrome, you can use the CSS properties Background-color Rgba to easily achieve background transparency, while text remains opaque. The Ie6/7/8 browser does not support RGBA, only the use of IE's exclusive filter filter:alpha to achieve, but this writing will also make the text transparent, so only in the transparent container child nodes (except the text node) set position: Relative can not inherit the transparent filter of its parent element, the code is as follows:
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">
<HTMLxmlns= "http://www.w3.org/1999/xhtml">
<Head>
<Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />
<title>Web Developer Network-www.admin10000.com</title>
<styletype= "Text/css">
. Warp{background:#eee URL (back.jpg) no-repeat left top;width:440px;Height:400px;Border:1px solid #ccc;}
. Content{width:180px;Height:260px;margin:0px Auto;padding:30px 30px;background:Rgba (255, 255, 255, 0.6)!important;
Filter:Alpha (opacity=60);background:#fff; /*use IE-specific filters for IE background transparency*/ }
. Content P{position:relative;} /*realize IE text opaque*/
</style>
</Head>
<Body>
<Pclass= "Warp">
<Pclass= "Content"><P>admin10000.com is a web Developer Learning Communication Essentials website. Admin10000.com is a web Developer Learning Communication Essentials website. Admin10000.com is a web Developer Learning Communication Essentials website. Admin10000.com is a web Developer Learning Communication Essentials website. Admin10000.com is a web Developer Learning Communication Essentials website. Admin10000.com is a web Developer Learning Communication Essentials website. </P></P>
</P>
</Body>
</HTML>
The above code is tested in Ie6.0+/ff3.0+/opera10+/chrome/safari