zoukankan      html  css  js  c++  java
  • HTML5-布局的使用

    DIV布局:

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>div布局</title>
        <style type="text/css">
            body{
                margin: 0px;
            }
            #container{
                width: 100%;
                height: 950px;
                background-color: cadetblue;
            }
            #heading{
                width: 100%;
                height: 10%;
                background-color: aqua;
            }
            #content_menu{
                width: 30%;
                height: 80%;
                background-color: #ed3cff;
                float: left;
            }
            div#content_body{
                width: 70%;
                height: 80%;
                background-color: blueviolet;
                float: left;
            }
            #footing{
                width: 100%;
                height: 10%;
                background-color: black;
                clear: both;
                /*clear: both;:清除浮动。*/
            }
        </style>
    </head>
    <body>
    <div id="container">
        <div id="heading">头部</div>
        <div id="content_menu">内容菜单</div>
        <div id="content_body">内容主体</div>
        <div id="footing">底部</div>
    </div>
    </body>
    </html>

    表格布局:


    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>table布局</title>
    </head>
    <body marginheight="0px" marginwidth="0px">
    <!--marginheight="0px" marginwidth="0px":页边距-->
    <table width="100%" height="950px" style="background-color: chocolate">
        <tr>
            <td colspan="2" width="100%" height="10%" style="background-color: blueviolet">头部</td>
            <!-- colspan="2":合并单元格-->
        </tr>
        <tr>
            <td width="30%" height="80%" style="background-color: chartreuse">
                <ul>
                    <li>ios</li>
                    <li>html5</li>
                    <li>windows</li>
                    <li>Mac os</li>
                </ul>
            </td>
            <td width="70%" height="80%" style="background-color: darkolivegreen">主页面</td>
        </tr>
        <tr>
            <td width="100%" height="10%" colspan="2" style="background-color: teal">底部</td>
        </tr>
    </table>
    </body>
    </html>
  • 相关阅读:
    插入排序
    关于“Scrum敏捷项目管理”
    结对编程体会
    PSP(3.13——3.15)以及周记录
    关于“类似软件的评价”作业(续)
    关于“代码规范”,“Review”和“Check list”(续)
    关于“类似软件的评价”作业
    关于“代码规范”,“Review”和“Check list”
    关于PSP(个人软件过程)
    软件工程管理——第一次作业
  • 原文地址:https://www.cnblogs.com/wintuzi/p/4396511.html
Copyright © 2011-2022 走看看