div 浮动
浮动
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>form表单</title> <style> #fd { width: 100px; height: 150px; background-color: red; float: left; } #sd { width: 150px; height: 100px; background-color: blue; float: left; } #td { width: 100px; height: 100px; background-color: green; float: left; } #container { width: 300px; height: 500px; background-color: darkgrey; float: left; } #text { clear: both; } </style> </head> <body> <div id="container"> <div id="fd"></div> <div id="sd"></div> <div id="td"></div> <div id="text">Hello World!</div> </div> </body> </html>