zoukankan      html  css  js  c++  java
  • 浮动布局demo

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title>浮动布局</title>
            <style type="text/css">
            *{
                margin: 0;
                padding: 0;
            }
                header{
                    height: 150px;
                    background: yellow;
                }
                nav{
                    height: 30px;
                    background: green;
                }
                .main{
                    width: 1000px;
                    background: red;
                    /*height: 500px;*/
                    margin: 0 auto;
                    overflow: hidden;
                }
                /*两列/三列布局*/
                .left{
                    width: 200px;
                    height: 300px;
                    background: blue;
                    /*display: inline-block;*/
                    float:left; /*脱离文档流 的布局方式*/
                }
                .right{
                    width: 800px;
                    height: 500px;
                    background: pink;
                    float: left;
                    /*display: inline-block;
                    vertical-align: top;*/
                }
                footer{
                    height: 100px;
                    background: gold;
                }
                /*多行多列布局*/
                .box{
                    width: 240px;
                    height: 100px;
                    border: 1px black solid;
                    float: left;
                    margin: 10px;
                    /*box-sizing: border-box;*/
                }
            </style>
        </head>
        <body>
            <header></header>
            <nav></nav>
            <div class="main">
                <div class="left"></div>
                <div class="right">
                    <div class="content">
                        <div class="box"></div>
                        <div class="box"></div>
                        <div class="box"></div>
                        <div class="box"></div>
                        <div class="box"></div>
                        <div class="box"></div>
                    </div>
                </div>
            </div>
            <footer></footer>
        </body>
    </html>
  • 相关阅读:
    [转]使用RDLC报表
    WPF 导出Excel 导出图片
    细说WPF自定义路由事件
    [转]WPF更换主题
    推荐5款超实用的.NET性能分析工具
    Hibernate框架
    C#的protected internal
    C#的类修饰符和成员修饰符
    C#的foreach
    C#接口
  • 原文地址:https://www.cnblogs.com/lhl66/p/7528294.html
Copyright © 2011-2022 走看看