課程
/前端開發
/HTML/CSS
/如何用CSS進行網頁布局
這個是否與先后設定的順序有關?
2016-02-19
源自:如何用CSS進行網頁布局 5-1
正在回答
因為講解中“mian”設了600PX的高度,而練習中由“mian”沒設高度。
kelvinwong 提問者
<style type="text/css">
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{height:100px;background:#ccc;}
.main{height:600px;background:red;}
.left{background:blue;width:200px;height:600px;position:absolute;top:100px;}
.right{background:green;height:600px;margin-left:210px;}
.foot{background:#f63;height:50px;}
</style>
main 設置了高度 只要足夠大 ? ,float浮動脫離文檔流后 帶來的影響 就體現不出來了。
舉報
用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-02-19
因為講解中“mian”設了600PX的高度,而練習中由“mian”沒設高度。
2016-02-19
<style type="text/css">
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{height:100px;background:#ccc;}
.main{height:600px;background:red;}
.left{background:blue;width:200px;height:600px;position:absolute;top:100px;}
.right{background:green;height:600px;margin-left:210px;}
.foot{background:#f63;height:50px;}
</style>
2016-02-19
main 設置了高度 只要足夠大 ? ,float浮動脫離文檔流后 帶來的影響 就體現不出來了。