最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

html5 div布局與table布局詳解

  發(fā)布時(shí)間:2016-11-16 16:51:36   作者:csdn9_14   我要評(píng)論
這篇文章主要為大家詳細(xì)介紹了html5 div布局與table布局,區(qū)分div布局與table布局的異同,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家解析了html5 div布局與table布局,供大家參考,具體內(nèi)容如下

div布局:html+css實(shí)現(xiàn)簡(jiǎn)單布局。

#container中height不能寫(xiě)成百分?jǐn)?shù),必須為具體高度。

<!DOCTYPE html>  
<html>  
<head lang="en">  
    <meta charset="UTF-8">  
    <title>div布局</title>  
    <style type="text/css">  
        body{  
            margin:0;  
            padding:0;  
        }  
        #container{  
            width:100%;  
            height:650px;  
            background-color: aqua;  
        }  
        #heading{  
            width:100%;  
            height:10%;  
            background-color: azure;  
        }  
        #content-menu{  
            width:30%;  
            height:80%;  
            background-color: chartreuse;  
            float:left;  
        }  
        #content-body{  
            width:70%;  
            height:80%;  
            background-color: chocolate;  
            float:left;  
        }  
        #footer{  
            width:100%;  
            height:10%;  
            background-color: darkgrey;  
            clear: both;  
        }  
    </style>  
</head>  
<body>  
    <div id="container">  
        <div id="heading">頭部</div>  
        <div id="content-menu">內(nèi)容菜單</div>  
        <div id="content-body">內(nèi)容主體</div>  
        <div id="footer">底部</div>  
    </div>  
</body>  
</html>  

效果圖:

table布局:

<!DOCTYPE html>  
<html>  
<head lang="en">  
    <meta charset="UTF-8">  
    <title>table布局</title>  
</head>  
<body marginwidth="0px" marginheight="0px">  
    <table width="100%" height="650px" style="background-color: aqua">  
        <tr>  
            <td colspan="3" width="100%" height="10%" style="background-color: chartreuse">這是頭部</td>  
        </tr>  
        <tr>  
            <td width="20%" height="80%" style="background-color: antiquewhite">左菜單</td>  
            <td width="60%" height="80%" style="background-color: coral">內(nèi)容</td>  
            <td width="20%" height="80%" style="background-color: cornflowerblue">右菜單</td>  
        </tr>  
        <tr>  
            <td colspan="3" width="100%" height="10%" style="background-color: crimson">這是底部</td>  
        </tr>  
    </table>  
</body>  
</html>  

效果圖:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • HTML利用九宮格原理進(jìn)行網(wǎng)頁(yè)布局

    這篇文章主要介紹了HTML利用九宮格原理進(jìn)行網(wǎng)頁(yè)布局,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2020-03-13
  • 吃透移動(dòng)端 Html5 響應(yīng)式布局

    這篇文章主要介紹了吃透移動(dòng)端 Html5 響應(yīng)式布局,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)
    2019-12-16
  • 詳解html5頁(yè)面 rem 布局適配方法

    本篇文章主要介紹了詳解html5頁(yè)面 rem 布局適配方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-01-12
  • HTML+CSS實(shí)現(xiàn)單列布局水平居中布局

    這篇文章主要介紹了HTML+CSS實(shí)現(xiàn)單列布局水平居中布局的相關(guān)資料,需要的朋友可以參考下
    2017-09-06
  • HTML使用柵格布局實(shí)現(xiàn)六種篩子樣式的代碼詳解

    這篇文章主要介紹了HTML使用柵格布局實(shí)現(xiàn)六種篩子的樣式,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-06-03

最新評(píng)論

阿荣旗| 米脂县| 涿州市| 天水市| 阳东县| 酒泉市| 晋城| 高唐县| 涪陵区| 景宁| 正定县| 广德县| 西畴县| 和龙市| 西华县| 嵊州市| 宁海县| 盘锦市| 达拉特旗| 岳池县| 丹巴县| 邵阳市| 大悟县| 巩义市| 南澳县| 芒康县| 布尔津县| 兰坪| 斗六市| 道真| 老河口市| 新乡县| 山丹县| 弋阳县| 虎林市| 玛曲县| 米脂县| 昆山市| 兴安县| 黄大仙区| 久治县|