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

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

如何用CSS進行網頁布局

江老實 Web前端工程師
難度初級
時長22分
學習人數
綜合評分9.60
1991人評價 查看評價
9.8 內容實用
9.6 簡潔易懂
9.4 邏輯清晰
  • .top{width:100%; height:50px;background:gray;}

    .main{height:400px;background:red;margin:0 500px 0 400px;}

    .left{width:400px;height:400px;background:blue;position:absolute;left:0;top:50px;}

    .right{width:500px;height:400px;background:cyan;position:absolute;right:0;top:50px;?}

    .foot{width:100%; height:30px;background:orange;}


    查看全部
    0 采集 收起 來源:編程挑戰

    2018-05-14

  • margin: 0 auto;居中對齊

    查看全部
    0 采集 收起 來源:練習題

    2018-05-13

  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>二列布局</title>
    <style type="text/css">
    body{ margin:0; padding:0; font-size:30px; font-weight:bold}
    div{ text-align:center; line-height:50px}
    .main{ width:960px; height:600px; margin:0 auto}
    .left{ width:300px; height:600px; background:#ccc; float:left;}}/*左浮動樣式*/
    .right{ width:660px; height:600px; background:#FCC; float:right;}/*右浮動樣式*/
    </style>
    </head>

    <body>
    <div class="main">
    ??? <div class="left">left</div>
    ??? <div class="right">right</div>
    </div>
    </body>


    查看全部
    0 采集 收起 來源:編程練習

    2018-05-10

  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>三列布局</title>
    <style type="text/css">
    body{ margin:0; padding:0; font-size:30px; font-weight:bold}
    div{ line-height:50px}
    .left{ width:200px; height:600px; background:#ccc; position:absolute; left:0; top:0}
    .main{ height:600px; margin:0 310px 0 210px; background:#9CF}
    .right{ height:600px; width:300px; position:absolute; top:0; right:0;top:0; background:#FCC;}
    </style>
    </head>

    <body>
    ???
    ??? <div class="left">left</div>
    ??? <div class="main">設計首頁的第一步是設計版面布局。就象傳統的報刊雜志編輯一樣,我們將網頁看作一張報紙,一本雜志來進行排版布局。 雖然動態網頁技術的發展使得我們開始趨向于學習場景編劇,但是固定的網頁版面設計基礎依然是必須學習和掌握的。它們的基本原理是共通的,你可以領會要點,舉一反三。</div>
    ??? <div class="right">right</div>
    </body>
    </html>


    查看全部
    0 采集 收起 來源:編程練習

    2018-05-10

  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>一列布局</title>
    <style>
    body{ margin:0; padding:0; font-size:30px; font-weight:bold}
    div{ text-align:center; line-height:50px}
    .head, .main, .footer{width:80%;margin:0 auto}
    .head{ height:100px; background:#ccc;margin:0 auto;}
    .main{ height:600px; background:#FCC; margin:0 auto;}
    .footer{ height:50px; background:#9CF;margin:0 auto;}
    </style>
    </head>
    ?.main,.footer{ width:960px; margin:0 auto;}
    <body>
    <div class="head">head</div>
    <div class="main">main</div>
    <div class="footer">footer</div>
    </body>
    </html>

    查看全部
    0 采集 收起 來源:編程練習

    2018-05-10

  • <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>一列布局</title>

    <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>

    </head>


    <body>

    <div class="head">head</div>

    <div class="main">main</div>

    <div class="footer">footer</div>

    </body>

    </html>


    查看全部
    0 采集 收起 來源:編程練習

    2018-05-10

  • https://img1.sycdn.imooc.com//5af2d6e30001056806660507.jpg

    查看全部
    0 采集 收起 來源:實踐題

    2018-05-09

  • https://img1.sycdn.imooc.com//5af2c6f00001129908570480.jpg

    查看全部
    0 采集 收起 來源:三列布局

    2018-05-09

  • https://img1.sycdn.imooc.com//5af2c6be000183df08580479.jpg

    查看全部
    0 采集 收起 來源:三列布局

    2018-05-09

  • 因為left脫離了文檔流,所以right是占滿整個main的,但由于right自身設定了margin-left,因此做的紅色背景“空”空出來了。

    解決了疑問:right是塊級元素,不應該在left下面嗎?怎么跑到main右側去了?

    查看全部
    1 采集 收起 來源:編程挑戰

    2018-05-09

  • .top{ height:100px;background:#9CF}

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

    .head{ height:100px; background:#F90}


    查看全部
    0 采集 收起 來源:實踐題

    2018-05-05

  • 邊界的值是按照順時針的方向,上右下左的順序

    查看全部
    0 采集 收起 來源:編程練習

    2018-05-03

  • 混合布局

    查看全部
    1 采集 收起 來源:編程挑戰

    2018-05-03

  • 轉載

    5-3 編程挑戰

    <style type="text/css">
    body{ margin:0; padding:0; font-size:30px; color:#fff}
    .top{height:100px; background:#ccc;}
    .main{height:500px; background:red; position:relative;}
    .left{width:200px; height:500px; background:blue; position:absolute; top:0; left:0;}
    .right{height:500px; background:green; margin:0 0 0 220px;}
    .foot{height:50px; background:yellow;}
    </style>


    查看全部
    0 采集 收起 來源:編程挑戰

    2018-05-02

  • 兼容性較好的三種清除浮動方法:<br>
    一、設置父級高度<br>
    二、使用overflow:hidden<br>
    三、使用clear:both

    查看全部
    0 采集 收起 來源:實踐題

    2018-05-02

舉報

0/150
提交
取消
課程須知
1.你需要掌握html+css樣式基礎知識 2.有一定的前端實際開發經驗
老師告訴你能學到什么?
1.掌握網頁布局的相關知識 2.能對不同的網頁進行布局結構劃分 3.掌握固定寬度和自適應寬度的實現方法

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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