61,111
社区成员
发帖
与我相关
我的任务
分享
<!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=utf-8" />
<title>设置DIV浮动</title>
<style type="text/css">
.left_conter div,.right_conter div{ padding:0px; width:350px;margin:5px 0px 5px 10px!important; margin:5px 5px 5px 5px; border:1px solid #ff0000;}
.left_conter,.right_conter{ float:left;}
</style>
</head>
<body>
<div class="left_conter">
<div>div1</div>
<div>div3</div>
<div>div4</div>
<div>div5</div>
<div>div7</div>
</div>
<div class="right_conter">
<div>
<p>div2</p>
<p> </p>
</div>
<div>div6</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dta">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Centent-Type" content0"text/html; charset=gb2312"/>
<title>设置DIV浮动</title>
<style type="text/css">
.left_center{ padding:0px; width:750px;}
.center_cate{ float:left; padding:0px; width:350px;margin:5px 0px 5px 10px!important; margin:5px 5px 5px 5px; border:1px solid #ff0000;}
.clear{clear:both;}/*清除浮动*/
</style>
</head>
<body>
<div class="left_center">
<div style="">
<div style="float: left">
<div class="center_cate" >
div1
</div>
<div class="center_cate" style="clear: both;" >
div3
</div>
</div>
<div class="center_cate" style="float: left">
<p>div2</p>
<p> </p>
<p> </p>
</div>
<div style="clear: both;"></div>
</div>
<div class="center_cate">
div4
</div>
<div class="center_cate">
div5
</div>
<div class="center_cate">
div6
</div>
<div class="center_cate">
di7
</div>
<div class="clear">
</div>
</div>
</body>
</html>