abstract:<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>float會脫離文檔流,使用完畢及時用clear:both;清除 </title>&l
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>float會脫離文檔流,使用完畢及時用clear:both;清除 </title>
<style>
ul li{
list-style:none;
width:100px;
height:30px;
line-height:30px;
text-align:center;
/* border:1px solid red; */
background:green;
margin: 0px 2px;
float:left;
}
.box{
width:200px;
height:200px;
background:yellow;
margin:2px 2px;
float:left;
}
.clear{
clear:both;
/* left/right/both */
}
/*浮動會脫離文檔流,使用完畢及時用clear:both;清除 */
</style>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
<hr/>
<div class="clear"></div>
<div class="box">one</div>
<div class="box">two</div>
<div class="box">three</div>
</body>
</html>
Correcting teacher:查無此人Correction time:2018-11-15 16:48:54
Teacher's summary:你說的對,我就不需要說什么了,少年加油。