html圣杯布局

效果图

html圣杯布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>圣杯布局</title>
    <style>

        body{

            margin: 0;
            padding: 0;
            min-width: 600px;
        }
        .header,.footer{

            width: 100%;
            height: 100px;
            background-color: greenyellow;
            text-align: center;
            line-height: 100px;
        }
        .container{

            padding: 0 200px;
            overflow: hidden;
        }
        .common{

            float: left;
            height: 500px;
            position: relative;
            
        }
        .center{

            background-color: green;
            width: 100%;
        }
        .left{

            width: 200px;
            margin-left: -100%;
            background-color: red;
            left: -200px;
        }
        .right{

            width: 200px;
            margin-left: -200px;
            background-color: blue;
            right: -200px;
        }

    </style>

</head>
<body>

    <div class="header">#header</div>

    <div class="container">
        <div class="common center">#center</div>
        <div class="common left">#left</div>
        <div class="common right">#right</div>
    </div>
    
    <div class="footer">#footer</div>
    
</body>
</html>
上一篇:SVG填充图案


下一篇:SVG坐标系统变换