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

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

和效果圖對不上

直接輸入margin:0 auto;結果和設計圖根本對不上啊,沒人發現么?header欄并沒有填滿瀏覽器,反而是main和footer填滿了

正在回答

4 回答

main和footer并沒有設置width,你設置一下width:90%

0 回復 有任何疑惑可以回復我~
#1

你若盛開0 提問者

非常感謝!
2016-03-19 回復 有任何疑惑可以回復我~

我的和樓主情況一樣

0 回復 有任何疑惑可以回復我~

我打開也不是這樣的,但是在Editplus中打開 ?卻是正確的

0 回復 有任何疑惑可以回復我~

margin:0 auto,其實就是等價于margin-top:0;margin-bottom:0;margin-left:0;margin-right:0,

輸入結果前,代碼是這樣子的:

<style type="text/css">

body{ margin:0; padding:0; font-size:30px}

div{ text-align:center; font-weight:bold}

.main,.footer{ width:960px; 【任務1】}

.head{ width:100%; height:100px; background:#ccc}

.main{ height:600px; background:#FCC;}

.footer{ height:50px; background:#9CF;}

</style>

輸入結果后可以是這樣子

<style type="text/css">

body{ margin:0; padding:0; font-size:30px}

div{ text-align:center; font-weight:bold}

.main,.footer{ width:960px;margin:0 auto; }

.head{ width:100%; height:100px; background:#ccc}

.main{ height:600px; background:#FCC;}

.footer{ height:50px; background:#9CF;}

</style>

<style type="text/css">

body{ margin:0; padding:0; font-size:30px}

div{ text-align:center; font-weight:bold}

.main,.footer{ width:960px; }

.head{ width:100%; height:100px; background:#ccc}

.main{ height:600px; background:#FCC;margin:0 auto;}

.footer{ height:50px; background:#9CF;margin:0 auto;}

</style>

http://img1.sycdn.imooc.com//56ed2af90001833104060794.jpg

全屏點開后

http://img1.sycdn.imooc.com//56ed2ca60001c1ac14640783.jpg

0 回復 有任何疑惑可以回復我~
#1

你若盛開0 提問者

我的打開后不是這個樣子,不知道為什么,還是謝謝你
2016-03-19 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
如何用CSS進行網頁布局
  • 參與學習       209566    人
  • 解答問題       1206    個

用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能

進入課程

和效果圖對不上

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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