<p class="notaffected">这个p元素在浮动元素前,它不受影响</p> <div class="box1">box1</div> <div class="box2">box2</div> <p class="notaffected">这个p元素在浮动元素box2之后并且是紧邻其后的元素,受影响</p>
.box1{ height:100px; background:#99FF33; float:left; } .box2{ height:100px; background:#FF99FF; float:left; } .notaffected{ background:lightgray; }