设置了浮动的元素,仍然处于标准文档流中,会对相邻的元素产生影响,相邻元素特指紧邻后面的元素,老师的这句话好像值得商榷啊,设置了浮动的元素之前的行内元素好像也会收影响
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.box1{background-color: red; height: 100px;float: left;}
.box2{background-color: yellow;height: 100px;}
</style>
</head>
<body>
<p>asdfgasdfasdf</p>
<span>assdgfhsdfgh</span>
<div class="box1">box1</div>
<div class="box2">box2</div>
<p>asdfgasdfasdf</p>
</body>
</html>