现在的位置: 首页 > 综合 > 正文

绝对定位法三栏布局自适应

2012年03月11日 ⁄ 综合 ⁄ 共 507字 ⁄ 字号 评论关闭

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>绝对定位法</title>
<style>
.parent{
margin:auto;
background:#09F;
position:relative;
}
.left{
width:200px;
height:200px;
background:#369;
position:absolute;
left:0;
top:0;
}
.right{
width:250px;
height:200px;
background:#C0C;
position:absolute;
right:0;
top:0;
}
.center{
background:#F00;
margin:0 250px 0 200px;
height:200px;
}
</style>
</head>
<body>
<div class="parent">
<div class="center"></div>
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>

博客已经迁移到:http://sanjh.cn,欢迎围观

抱歉!评论已关闭.