課程
/前端開發
/HTML/CSS
/如何用CSS進行網頁布局
題目是要求right先加載,答案中是把left放在前面加載才能實現的,沒有使用任何定位;正確應該是需要把left做絕對定位,給right一個210px的margin-left
2015-11-22
源自:如何用CSS進行網頁布局 5-3
正在回答
body{ margin:0; padding:0; font-size:30px; color:#fff}.top{width:100%;height:80px;background:#ccc;}.main{width:600px;height:600px;margin:0 auto; background:red;position:relative;}.left{width:200px;height:600px;position:absolute;left:0;top:0; background:blue;? /*相對于Main定位*/}.right{width:100%; height:600px;float:right;background:#9acca9;position:absolute;left:210px;top:0;/*相對于Main定位,定位于右邊210px,中間就空了10個像素*/}.foot{width:100%;height:50px;background:#f63;}
也搞不懂先加載right什么意思,right寫在left前面,本身就是先解析right的
我是沒搞懂他這個先加載和后加載是什么意思。
舉報
用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-01-05
body{ margin:0; padding:0; font-size:30px; color:#fff}
.top{width:100%;height:80px;background:#ccc;}
.main{width:600px;height:600px;margin:0 auto; background:red;position:relative;}
.left{width:200px;height:600px;position:absolute;left:0;top:0; background:blue;? /*相對于Main定位*/}
.right{width:100%; height:600px;float:right;background:#9acca9;position:absolute;left:210px;top:0;/*相對于Main定位,定位于右邊210px,中間就空了10個像素*/}
.foot{width:100%;height:50px;background:#f63;}
2015-12-03
也搞不懂先加載right什么意思,right寫在left前面,本身就是先解析right的
2015-11-22
我是沒搞懂他這個先加載和后加載是什么意思。