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

    <!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{
                    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;*/
                }
                /*.a{
                     200px;
                    height: 300px;
                    background: blue;
                    float:right;
                }*/
                .main{
                    width: 1000px;
                }
                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>
  • 相关阅读:
    ThreadPoolExecutor源码解析
    AQS框架
    (转)rvm安装与常用命令
    (转).gitignore详解
    (转)可简化iOS 应用程序开发的6个Xcode小技巧
    (转)webView清除缓存
    (转)git常见错误
    iOS本地通知
    (转)iOS获取设备型号
    (转)iOS平台UDID方案比较
  • 原文地址:https://www.cnblogs.com/lhl66/p/7475557.html
Copyright © 2011-2022 走看看