您好,欢迎访问一九零五行业门户网

CSS如何设置div背景透明样式的实例分析

p背景透明样式:
样式代码:
.alert{filter:alpha(opacity=100); /* ie */ -moz-opacity:1.0; /* moz + ff */ opacity: 1.0; height:300px; width:500px; background:#ccc; left:50%; top:50%;margin-top:-150px;margin-left:-250px;position:absolute;z-index:99; text-align:center; padding:20px;}
使用方法:
<p class=”alert”> 背景透明 </p>
html代码:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http- equiv="content-type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> .alert {filter:alpha(opacity=100); /* ie */ -moz-opacity:1.0; /* moz + ff */ opacity: 1.0; height:300px; width:500px; background:#ccc; left:50%; top:50%;margin-top:-150px;margin-left: -250px;position:absolute;z-index:99; text-align:center; padding:20px} </style> </head> <body> <p class="alert"><a href="http://www.100sucai.com">www.100sucai.com</a></p> </body> </html>
以上就是css如何设置div背景透明样式的实例分析的详细内容。
其它类似信息

推荐信息