CSS中的浮动
青溪2019-04-09 16:40:38147<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CSS中的浮动</title>
<style type="text/css">
ul li{list-style: none;width: 120px;height: 50px;line-height: 50px;text-align: center;background-color: burlywood;margin: 0px 1px;float:left;}
.box1{width:160px;height:160px;background-color: cadetblue;float:left;}
.clear{clear:both;}
</style>
</head>
<body>
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
<li>Pear</li>
<li>Watermelon</li>
</ul>
<div class="clear"></div>
<div class="box1">name1</div>
<div class="box1">name2</div>
<div class="box1">name3</div>
</body>
</html>