zoukankan      html  css  js  c++  java
  • 经典三栏布局

    1. 采用浮动的方式
    <!DOCTYPE>
    <html>
        <head>
            <meta charset="utf-8">
            <title>三栏布局</title>
            <style>
                *{
                    padding: 0;
                    margin: 0;
                }
                
                #wrap1{
                    margin: 0 100px;
                }
                #wrap div{
                    height: 300px;
                }
                #wrap .left{
                    float: left;
                     200px;
                    background: green;
                }
                #wrap .content{
                    margin: 0 200px;
                    background: red;
                }
                #wrap .right{
                    float: right;
                     200px;
                    background: yellow;
                }
            </style>
        </head>
        <body>
            <div id="wrap">
                <div class="left"></div>
                <div class="right"></div>
                <div class="content"></div>
            </div>
        </body>
    </html>
    
    1. 采用flex方式
    <!DOCTYPE>
    <html>
        <head>
            <meta charset="utf-8">
            <title>三栏布局</title>
            <style>
                *{
                    padding: 0;
                    margin: 0;
                }
    
                #wrap{
                    margin: 20px 100px;
                    display: flex;
                    flex-flow: row nowrap;
                }
                #wrap div{
                    height: 300px;
                }
                #wrap .left{
                    flex-grow: 0;
                     200px;
                    background: green;
                }
                #wrap .content{
                    flex: 1 1 auto;
                    background: red;
                }
                #wrap .right{
                    flex-grow: 0; 
                     200px;
                    background: yellow;
                }
            </style>
        </head>
        <body>
            <div id="wrap">
                <div class="left"></div>
                <div class="content"></div>
                <div class="right"></div>
            </div>
        </body>
    </html>
    

    目前感觉这两种方式比较实用,欢迎补充

  • 相关阅读:
    windows nginx
    stdClass 标准
    array_merge
    array_pop
    array_push
    array_unique
    GMT与UTC简介(转)
    curl-手册
    13.5. zipfile — Work with ZIP archives
    7. Input and Output
  • 原文地址:https://www.cnblogs.com/stone-it/p/7373296.html
Copyright © 2011-2022 走看看