12.28 再發一遍浮動…6-9
阿新 • • 發佈:2019-02-03
vs真好用,醜是醜了點,但是按照首頁佈局,都試了一遍,也測試和理解了div的包含關係,實際上已經看到邊框了,但是進度還是慢的,感覺又要被嫌棄了…
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>x飛第二頁</title> <style> #container{ width:1002px; background:grey; } #header{ height:120px; background:green; } #main{ height:400px; background:pink; } #footer{ height:200px; background:yellow; } #lside { float: left; height:400px; width:700px; background:red; } #lside1{ height:120px; width:1300px; background:purple; } .lside2{ height:120px; clear:both; width:1002px; background:black; } #rside { float: right; height: 200px; width: 200px; background: blue; /*這是解釋?(css的)*/ } </style> </head> <body> <div id="container"> <div id="header">標題行</div> <div id="main"> <div id="lside"> <div class="lside2"></div> <div id="lside1"></div> <div class="lside2"></div><!--這個不會被覆蓋,因為屬於lside--> </div> <div id="rside"></div> <div class="lside2"></div><!--這個為什麼不顯示,是被覆蓋掉了?--> </div> <div class="lside2"></div><!--這個不會被覆蓋,因為屬於container,clear main--> <div id="footer"></div> </div> </body> </html>