<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>float演练</title> <style> #div1 { border: 2px; background-color: deeppink; width: 200px; height: 100px; float: left; } #div2 { border: 2px; background-color: sandybrown; width: 200px; height: 100px; } #div3 { border: 2px; background-color: darkred; width: 200px; height: 100px; } #clear-float { clear: both; } </style> </head> <body> <div id="div1">div1</div> <!--<div style="clear: left"></div>--> <div id="clear-float"></div> <div id="div2">div2</div> <div id="div3">div3</div> </body> </html>
float演练
div1
div2
div3
浙公网安备 33010602011771号