<!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" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style type="text/css">
body{margin: 0;}
.main{width:906px;border:5px solid black;margin:0 auto;}
.main::after{content: "";display:block;clear:both;}
.left{float:left;width:250px;border: 1px solid red;}
.left .top1{height: 100px;background: green;}
.left .top2{height: 200px;background: blue;}
.left .top3{height: 300px;background: gray;}
.left .top4{height: 100px;background: blue;}
.center{float:left;width:400px;border: 1px solid blue;}
.center .top{height: 700px;background: yellow;}
.right{float:left;width:250px;border: 1px solid yellow;}
.right .top1{height: 200px;background: green;}
.right .top2{height: ;ght: 250px;background: gray;}
.right .top3{height: 250px;background: blue;}
</style>
</head>
<body>
<div class="main">
<div class="left">
<div class="top1"></div>
<div class="top2"></div>
<div class="top3"></div>
<div class="top4"></div>
</div>
<div class="center">
<div class="top"></div>
</div>
<div class="right">
<div class="top1"></div>
<div class="top2"></div>
<div class="top3"></div>
</div>
</div>
</body>
</html>04_03.清浮动
最新推荐文章于 2024-10-22 16:17:26 发布
本文详细介绍了使用HTML和CSS进行网页布局的方法,包括容器设置、浮动元素及清除浮动等关键技术点。
4350

被折叠的 条评论
为什么被折叠?



