Maison > Article > interface Web > CSS让div背景透明
div背景透明样式:
样式代码:
.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;}
使用方法:
背景透明
html代码:
<meta http- equiv="Content-Type" content="text/html; charset=utf-8"> <title><span style="color: #333333;"><span style="color: #333333;">100素材网</span></span></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> <div class="alert"><span style="color: #333333;"><span style="color: #333333;">100素材网</span></span></div>