CSS浮动float的运用 float:left ,应用之后标签会脱离文档流,注意清除浮动
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css 的浮动</title>
<style type="text/css">
ul li{
list-style: none;
width:100px;
height:40px;
line-height: 40px;
text-align:center;
background:#ccc;
margin:5px 0;
float:left;
}
.box1{
width:200px;
height:200px;
border:1px solid red;
background-color: blue;
float:right;
}
.clear{
clear:both;
}
</style>
</head>
<body>
<ul>
<li>html</li>
<li>css</li>
<li>javascript</li>
<li>jquery</li>
<li>php</li>
</ul>
<div></div>
<div>div1</div>
<div>div2</div>
</body>
</html>