标签:utf-8 doc tom 大小 div+css charset har 清除 bottom
1.float浮动属性
left左浮动 right右浮动
2.clear 清除浮动
clear:both
3.overflow 溢出处理
hiddle 隐藏超出层大小的内容
scroll 无论内容是否超出层大小都添加滚动条
auto 超出时自动添加滚动条
eg:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Div+Css布局(浮动以及溢出处理)</title>
<style type="text/css">
body{
padding: 0px;
margin: 0px;
}
.div{
width: 960px;
height: 600px;
margin: 0 auto;
background-color: #f1f1f1;
}
.left{
float: left;
width: 260px;
height: 460px;
background-color: #cccccc;
}
.right{
float: right;
width: 690px;
height: 460px;
background-color: #dddddd;
}
.bottom{
clear: both;
width: 200px;
height: 960px;
background-color: red;
}
.jianjie{
width: 260px;
height: 20px;
background-color: red;
}
</style>
</head>
<body>
<div class="div">
<div class="left">
<div class="jianjie">
最后一节课最后一节课最后一节课最后一节课最后一节课
</div>
</div>
<div class="right"></div>
<div class="bottom"></div>
</div>
</body>
</html>
标签:utf-8 doc tom 大小 div+css charset har 清除 bottom
原文地址:http://www.cnblogs.com/lzp1103/p/7911991.html