美文网首页
圣杯布局--跟着李南江学编程

圣杯布局--跟着李南江学编程

作者: 63537b720fdb | 来源:发表于2020-02-18 20:47 被阅读0次

    圣杯布局就是三栏布局,左右两栏固定,中间一栏自适应

    image.png image.png
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="练习.css">
        <title>Document</title>
    </head>
    <body>
        <div class="box">
            <div class="center">ascsdcs.c,;cs,;s,c'asc,ascsdcs.c,;cs,;s,c'asc,
                ascsdcs.c,;cs,;s,c'asc,ascsdcs.c,;cs,;s,c'asc,ascsdcs.c,;cs,;s,c'asc,
                ascsdcs.c,;cs,;s,c'asc,ascsdcs.c,;cs,;s,c'asc,ascsdcs.c,;cs,;s,c'asc,
            </div>
            <div class="left">1</div>
            <div class="right">2</div>
        </div>
    </body>
    </html>
    
    *{
        margin: 0;
        padding: 0;
        list-style: none;
        font: normal;
    }
    .box{
        width: 800px;
        min-width: 300px;
        background: purple;
        padding: 0 100px;
        margin: 0 auto;
        overflow: hidden;
    }
    .center{
        width: 100%;
        height: 100px;
        background: blue;
        float: left;
    }
    .left,.right{
        width: 100px;
        height: 100px;
        background: red;
        float: left;
    }
    .left{
        margin-left: -100%;
        position: relative;
        left: -100px;
    }
    .right{
        margin-left: -100px;
        position: relative;
        left: 100px;
    }
    

    我正在跟着江哥学编程,更多前端+区块链课程: www.it666.com--跟着李南江学编程

    相关文章

      网友评论

          本文标题:圣杯布局--跟着李南江学编程

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