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>
  • 相关阅读:
    类成员指针
    css图片旋转
    px转化rem
    flexible.js页面布局
    SpringBoot-静态资源映射
    Springboot-日志框架
    Springboot-配置文件
    spring的xml和注解整合
    在mysql中将JSON数组转换为行数据[转]
    php 拼音
  • 原文地址:https://www.cnblogs.com/wintuzi/p/4396511.html
Copyright © 2011-2022 走看看