美文网首页
二栏布局一栏自适应和三栏布局中间自适应

二栏布局一栏自适应和三栏布局中间自适应

作者: 刘翾 | 来源:发表于2017-11-08 21:25 被阅读23次

    二栏布局一栏自适应

    效果图:


    这里写图片描述
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>二栏布局</title>
        <style type="text/css">
            body{
                margin: 0;
                padding: 0;
                height:100%;
            }
            .wrapper .left{
                height: 200px;
                margin-left:-200px;float:left;width:100%;
                background: green;
                word-wrap: break-word;
            }
            .wrapper .right{
                height: 200px;
                width: 200px;
                background: blue;
                float: right;
                word-wrap: break-word;
            }
        </style>
    </head>
    <body>
    <div class="wrapper">
        <div class="left">123123131321321321231231321231231313213213212312313212312313132132132123123132</div>
        <div class="right">13232132132132132132132132132123123131321321321231231321231231313213213212312313212312313132132132123123132</div>
    </div>
    
    </body>
    </html>
    

    三栏布局中间自适应

    效果图:


    这里写图片描述
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>三栏布局</title>
        <style>
            *{
                margin: 0;
                padding:0;
            }
    
            .right, .left{
                width: 100px;
            }
    
            .right, .left, .middle{
                height: 100px;
            }
    
            .right{
                float: right;
                background-color:#ffc;
                opacity: 0.5;
            }
    
            .left{
                float: left;
                background-color:#fcc;
                opacity:0.5;
            }
    
            .middle{
                margin: 0 100px;
                background-color:orange;
            }
        </style>
    </head>
    <body>
    
        <div class="right"></div>
        <div class="left"></div>
        <div class="middle"></div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:二栏布局一栏自适应和三栏布局中间自适应

          本文链接:https://www.haomeiwen.com/subject/tycumxtx.html