其他分享
首页 > 其他分享> > 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>

标签:right,圣杯,color,布局,width,html,background,200px,left
来源: https://blog.csdn.net/gaoxuaiguoyi/article/details/122771625