Css Div浮动叠加层效果
2009-06-05 18:19
260 查看
Css Div浮动叠加层效果,也不知道怎么描述这个效果,下面我做了个简单例子,兼容FF,IE浏览器。
还是先来看看网上常见应用到的例子:
截图中登陆所在层的浮动叠加层效果。
浮动叠加层效果本站例子演示浏览
下面是全部代码:
<!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=gb2312" />
<title>Css Div浮动叠加层效果</title>
<style type="text/css">
body {
margin : 0;
padding : 0;
font-size:12px;
}
#wrap {
position : relative;
width : 900px;
margin : 30px auto;
background : #ddd;
}
#header {
float : left;
width : 900px;
height : 150px;
background : url(banner.jpg) no-repeat 50% 10px;
}
#main {
float : left;
width : 590px;
height : 380px;
margin : 10px 0 20px 10px;
border : 1px solid #999;
background : #fff;
}
#sider {
float : right;
position : absolute;
width : 260px;
height : 560px;
top : -20px;
right : 18px;
border : 2px solid #03c;
background-color: #F2F2F2;
}
.clear {
clear : both;
}
</style>
</head>
<body>
<div id="wrap">
<div id="header">头部层 <a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div id="main">主题层<br /><a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div id="sider">叠加层<br /><a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div class="clear"></div>
</div>
</body>
</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=gb2312" />
<title>Css Div浮动叠加层效果</title>
<style type="text/css">
body {
margin : 0;
padding : 0;
font-size:12px;
}
#wrap {
position : relative;
width : 900px;
margin : 30px auto;
background : #ddd;
}
#header {
float : left;
width : 900px;
height : 150px;
background : url(banner.jpg) no-repeat 50% 10px;
}
#main {
float : left;
width : 590px;
height : 380px;
margin : 10px 0 20px 10px;
border : 1px solid #999;
background : #fff;
}
#sider {
float : right;
position : absolute;
width : 260px;
height : 560px;
top : -20px;
right : 18px;
border : 2px solid #03c;
background-color: #F2F2F2;
}
.clear {
clear : both;
}
</style>
</head>
<body>
<div id="wrap">
<div id="header">头部层 <a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div id="main">主题层<br /><a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div id="sider">叠加层<br /><a href="http://www.365css.cn">http://www.365css.cn</a></div>
<div class="clear"></div>
</div>
</body>
</html>
相关文章推荐
- Css Div浮动叠加层效果
- (转)css中通常会用到浮动与清除,也是一个必须掌握的知识点,概念性的东西不多说,下面举几个例子,来说明它的用法:1.文字环绕效果 2.多个div并排显示 3.清除浮动(默认显示)
- div+css布局控制div定位浮动层在背景图片上的半透明阴影效果
- 最简单的Div+ CSS弹出层效果
- DIV重叠 CSS让DIV层叠 两个DIV或多个DIV顺序重叠加
- CSS实现DIV感应鼠标Hover时的显示隐藏效果
- DIV 清除浮动--CSS 伪元素-- 阴影---鼠标事件
- 效果直逼flash的Div+Css+Js菜单
- DIV+CSS圆角效果的简易实现
- css实际技巧---父div中有浮动的子div,父容器不能自适应高度,清除浮动,父容器自适应高度
- 一个DIV+CSS导航条效果
- div+css顶部固定浮动
- 神奇!js+CSS+DIV实现文字颜色渐变效果
- [DIV/CSS] CSS-清除浮动
- DIV浮动效果
- css实现圣杯布局(两栏固定-中列浮动-中列div排在前面)--详解
- DIV实现CSS 的placeholder效果
- 纯div+css实现手风琴效果下拉框的两种方法
- 阴影效果 CSS+DIV
- div+css的图片滚动效果