亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

如何用CSS進行網頁布局

江老實 Web前端工程師
難度初級
時長22分
學習人數
綜合評分9.60
1991人評價 查看評價
9.8 內容實用
9.6 簡潔易懂
9.4 邏輯清晰
.top{height:200px;background:#CCCCCC;}
.main{height:600px;background:red;position:relative;}
.left{width:200px;height:600px;background:#0000FE;position:absolute;top:0px;left:0px;}
.right{height:600px;background:#9ACC99;margin-left:210px;}
.foot{height:200px;background:#FF6634}
.top{width:960px;margin:0 auto;background:#ccc;}
.main{width:960px;margin:0 auto;}
.left{float:left;width:297px;background:blue;border-right:3px solid red;height:500px;}
.right{float:right;width:660px;background:green;height:500px;}
.foot{width:960px;height:50px;margin:0 auto;background:#123;}
.top{height:100px;background:grey}
.main{width:1000px;height:600px;background:#ed1c24;margin:0 auto}
.left{width:300px;height:600px;background:blue;float:left}
.right{width:690px;height:600px;background:#3cb878;float:right;}
.foot{height:50px;background:#c88614;}
.left{ width:200px; height:600px; background:#ccc; position:absolute; left:0; top:0}
.main{ height:600px; background:#9CF;margin:0 310px 0 210px}
.right{ height:600px; width:300px; position:absolute; top:0; right:0; background:#FCC;}
說實話,在觀看的基本上都是新手,頁面處理的要明顯點,比如剛才說到嗎父級main,現在是做頁面效果,應該加個border,更加形象,兩列顯示在里面。我就是說說自己觀點,勿噴。慕課網我一直很支持的,加油。
.top{height:200px;background:orange;}
.main{height:600px;background:#f2f2f2;}
.left{height:600px;width:200px;background:blue;float:left;}
.right{height:600px;background:green;float:right;}
.foot{background:purple;}
狀態三種,塊挨著塊,塊包含著塊,塊疊加著塊
只說要浮動,為什么不浮動布局效果就亂了?
想要中間有空隙可以把.main里的width改大一點 因為藍色和粉色的大小已經擠滿了 所以沒有空隙 只有改大main才可以有空隙
過于簡單了
不錯,挺不錯
.top{width:100%;height:20vh;background:gray;}
.main{width:100%;background:red;display:flex;flex-direction:row-reverse;}
.left{width:200px;height:70vh;background:blue}
.right{width:100%;height:70vh;background:green;margin-left:10px;}
.foot{height:10vh;width:100%;background:orange;}
.left{ width:200px; height:600px; background:#ccc; position:absolute; left:0; top:0}
.main{ height:600px; margin-left:210px;margin-right:310px; background:#9CF}
.right{ height:600px; width:300px; position:absolute; top:0;right:0; background:#FCC;}
效果一樣的,但不知道main算不算水平居中,看上去沒毛病
改變運行 37 38代碼順序再做。這里好像錯了
慕課給的代碼錯了 不設置定位 left會被擠下去
課程須知
1.你需要掌握html+css樣式基礎知識 2.有一定的前端實際開發經驗
老師告訴你能學到什么?
1.掌握網頁布局的相關知識 2.能對不同的網頁進行布局結構劃分 3.掌握固定寬度和自適應寬度的實現方法

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消