CSS層透明效果,兼容性很好_層和布局特效
又一個(gè)CSS層透明效果,每次遇到這種代碼實(shí)現(xiàn)的方法都不一樣,當(dāng)然是最簡(jiǎn)便最好了,這段代碼就很簡(jiǎn)潔,而且兼容性好,實(shí)現(xiàn)的效果也不錯(cuò),比較理想了,至于透明度,這個(gè)可以自己改一下。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>CSS層的半透明效果 - /</title> <meta http-equiv="mrc-Type" mrc="text/html;charset=gb2312"> <style type="text/css"> body {1122123<img src='http://p1.mb5u.com/texiao/3/20100522231252307.gif' _fcksavedurl='http://p1.mb5u.com/texiao/3/20100522231252307.gif'>2244234background:url('http://p1.mb5u.com/texiao/3/20100522231252307.gif');} #box {position:relative; overflow:hidden; z-index:1; width:462px; margin:0 auto; border:1px solid #333;height:300px;paddign:30px;} #box #opa {position:absolute; z-index:-1; width:100%; height:100%; top:0; left:0; background:#fff; filter:alpha(opacity=86); opacity:0.6;} * #box #opa {height:10000px; height:10000px;} </style> </head> <body> <div id="box"><center><br><br><br>這個(gè)層是不是半透明了呢?</center><div id="opa"></div></div> </body> </html>