设置div背景透明的CSS样式
2015-05-22 10:38
267 查看
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;}
使用方法:
<div class=”alert”>
背景透明
</div>
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>
<div class="alert"><a href="http://www.100sucai.com">www.100sucai.com</a></div>
</body>
</html>
转载自:www.100sucai.com
样式代码:
.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;}
使用方法:
<div class=”alert”>
背景透明
</div>
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>
<div class="alert"><a href="http://www.100sucai.com">www.100sucai.com</a></div>
</body>
</html>
转载自:www.100sucai.com
相关文章推荐
- 设置div背景颜色透明度,内部元素不透明
- div设置背景图片且x轴重复排列的css样式
- 设置div背景透明两种方法
- div背景透明内容不透明与0.5PX边框兼容设置
- MFC 可以设置背景色、字体、字体颜色、透明背景的 Static 静态文本控件
- android 自定义Dialog背景透明及显示位置设置
- 设置SurfaceView 背景为透明
- 关于如何在iframe中设置背景颜色为透明
- 窗体无法设置背景透明
- Android开发之Activity设置透明背景
- symbian 设置 透明背景
- 做带缩略图的轮播切换涉及到的知识点——水平垂直居中、css样式重置、滤镜背景透明效果等
- WebView设置背景透明
- Swift开发教程--设置UIViewController的背景透明
- UISearchBar设置透明背景
- ie ff中设置flash背景透明
- android 设置Button或者ImageButton的背景透明
- 关于将navigationBar的背景设置成透明,并且让navigationItem展示出来
- android 自定义Dialog背景透明及显示位置设置