pbulic-container没有高度 所以clearfloat?
pbulic-container没有高度 所以clearfloat?什么意思啊
pbulic-container没有高度 所以clearfloat?什么意思啊
2016-06-28
<!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>无标题文档</title>
<style type="text/css">
.head{ border:red solid 1px;}
.comwidth{ width:1000px; margin:0 auto;}
.box1{ float:left; width:200px; background:red; height:50px; position:relative}
.box2{ float:right; width:400px; background:yellow;height:70px;}
.clearfix:before,
.clearfix:after {
content: ".";
display: block;
height: 0;
visibility: hidden;
}
.clearfix:after {clear: both;}
.clearfix {zoom: 1;} /* IE < 8 */
</style>
</head>
<body>
<div class="head clearfix">
<div class="comwidth">
<div class="box1"></div>
<div class="box2"></div>
</div>
</div>
</body>
</html>
举报