如图先设计一个大布局容器,在里面再设计两个div小面积的容器,这样更直观的说明浮动布局。
<style type="text/css"> #da{ width: 200px; height: 200px; border: 3px solid red; } #xiao1{ width: 50px; height: 50px; background: lightblue; } #xiao2{ width: 50px; height: 50px; background: yellow; } </style> </head> <body> <div id="da"> <div id="xiao1"></div> <div id="xiao2"></div> </div> </body>