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

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

如何用CSS進行網頁布局

江老實 Web前端工程師
難度初級
時長22分
學習人數
綜合評分9.60
1991人評價 查看評價
9.8 內容實用
9.6 簡潔易懂
9.4 邏輯清晰
  • <!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; color:#fff;text-align:center;}

    .top{height:50px;background:#ccc}

    .main{height:500px;background:red}

    .left{ height:500px;width:39%;background:blue;}

    .right{height:500px;width:60%;background:green;float:right;}

    .foot{height:50px;background:#f63}

    </style>


    </head>


    <body>

    <div class="top">top</div>

    <div class="main">

    ? ? <div class="right">right</div>

    ? ? <div class="left">left</div>

    </div>

    <div class="foot">foot</div>


    </body>

    </html>


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

    2019-08-06

  • 混合布局
    <style>body{?margin:0;?padding:0;?font-size:30px;?font-weight:bold}div{?text-align:center;?line-height:50px}.top{?height:100px;background:#9CF}.head,.main{?width:960px;?margin:0?auto;}.head{?height:100px;?background:#F90}.left{?width:220px;?height:600px;?background:#ccc;?float:left;}.right{?width:740px;?height:600px;background:#FCC;?float:right}.r_sub_left{?width:540px;?height:600px;?background:#9C3;?float:left}.r_sub_right{?width:200px;?height:600px;?background:#9FC;?float:right;}.footer{?height:50px;?background:#9F9;clear:both;?}</style>


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

    2019-07-28

  • <!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}.top{?height:100px;background:#9CF}.head,.main{?width:960px;?margin:0?auto;}.head{?height:100px;?background:#F90}.left{?width:220px;?height:600px;?background:#ccc;?float:left;}.right{?width:740px;?height:600px;background:#FCC;?float:right}.r_sub_left{?width:540px;?height:600px;?background:#9C3;?float:left}.r_sub_right{?width:200px;?height:600px;?background:#9FC;?float:right;}.footer{?height:50px;?background:#9F9;clear:both;?}</style></head><body><div?class="top">????<div?class="head">head</div></div><div?class="main">????<div?class="left">left</div>????<div?class="right">????	<div?class="r_sub_left">sub_left????????</div>????????<div?class="?r_sub_right">sub_right????????</div>????</div></div><div?class="footer">footer</div></body></html>



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

    2019-07-28

  • 絕對 position:absolute

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

    2019-07-23

  • 以前總是弄不清絕對定位,今天看了老師的實操,終于知道了。之前弄不清定位,只清楚浮動,以為模塊都靠浮,并排一起,但是自己實操做網頁總是樣式亂七八糟,找不出個所以然來,目前明白了,謝謝老師。

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

    2019-07-17

  • 自適應:拖動瀏覽器窗口時自動調整

    width:%? 用px控制更精確

    一般為固定寬度的

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

    2019-06-26

  • margin: 0 auto;

    可以實現定寬元素居中

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

    2019-06-26

  • 布局:又稱版式布局,是網頁UI設計師將有限的視覺元素進行有機的排列組合

    網頁設計的特點:

    網頁可以自適應寬度

    網頁的長度理論上沒有限制

    分欄又稱為分列,常見的布局分為:一列布局,二列布局,三列布局,混合布局(多)

    前端工程師就是將藝術與技術融合的關鍵崗位

    CSS------>UI

    查看全部
    0 采集 收起 來源:內容簡介

    2019-06-26

  • 三列布局,讓左右兩邊的div定寬,中間的div自適應(讓左右兩個div絕對定位到左右,給中間div增加左右邊距):

    <div class="left">left</div>

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

    <div class="right">right</div>

    <style type="text/css">

    * {

    margin: 0;

    padding: 0;

    }

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

    right: 0;

    top: 0;

    background: #FCC;

    }

    </style>


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

    2019-06-23

  • 沒懂
    查看全部
    0 采集 收起 來源:評測題目

    2019-06-15

  • 在三列布局中,如果左右兩邊固定寬度,中間自適應寬度,用浮動float不能讓它們并排,要用到position:absolute;left:0;top:0;? position:absolute:right:0;top:0; (左右兩邊的屬性設置)。margin:0 300px 0200px(中間部分的設置)

    https://img1.sycdn.imooc.com//5d0455d800019c1f10820610.jpghttps://img1.sycdn.imooc.com//5d0455ef0001972c10720442.jpg

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

    2019-06-15

  • 用clear:both;清除浮動

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

    2019-06-12

  • .left{ width:200px; height:600px; background:#ccc; position:absolute; left:0; top:0} .main{ height:600px; margin:0 310px 0 210px; background:#9CF}(上右下左,順時針) .right{ width:300px; height:600px; position:absolute; right:0; top:0; background:#FCC;}

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

    2019-06-12

  • 一列布局:設置<div class="main">; body清除默認樣式{margin:0;padding:0};. main設置寬 ,高,背景色,{width:800px;height:300px;background:#ccc;(水平居中)margin:0 auto;}

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

    2019-06-12

  • clear:both 清楚函數

    margin:0 auto 水平居中

    左浮動 float:left

    右浮動 float:right

    高 height

    寬 widht

    背景顏色 background?

    絕對定位:absolute 和 fixed 統稱為絕對定位 (absolute==

    相對定位:relative

    默認值:static

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

    2019-06-05

舉報

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

微信掃碼,參與3人拼團

微信客服

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

幫助反饋 APP下載

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

公眾號

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

友情提示:

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