<!DOCTYPE html> <html> <head> <meta charset=utf-8> <style type="text/css"> * { margin: 0; padding: 0; width:300px; } .left{ height:120px; width:120px; float:left; background:red; } .center{ height:100px; width:100px; float:left; background:green; } .right{ height:100px; width:100px; float:left; background:blue; } </style> </head> <body> <div class="left"></div> <div class="center"></div> <div class="right"></div> </body> </html>
小萌新的题解。
考察:
- 浮动的特性