要求 #

代码 #

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>圣杯布局</title>
    <style>
        *{margin:0;padding:0;}
        body{min-width:700px;}
        .header,.footer{
            float:left;
            width:100%;
            background:#DDD;
            line-height:40px;
            text-align:center;
        }
        .container{
            padding:0 220px 0 200px;
        }
        .left,.right,.middle{
            position:relative;
            float:left;
            min-height:300px;
        }
        .middle{
            width:100%;
            float:left;
            background-color: lightpink;
        }
        .left{
            width:200px;
            background-color: lightsalmon;
            margin-left:-100%;
            left:-200px;
        }
        .right{
            width:220px;
            background-color: lightseagreen;
            margin-left:-220px;
            right:-220px;
        }
    </style>
</head>
<body>
<div class="header">
    <h4>header</h4>
</div>
<div class="container">
    <div class="middle">
        <h4>middle</h4>
        <p>这是页面的中间内容</p>
    </div>
    <div class="left">
        <h4>left</h4>
        <p>这是页面的左侧内容</p>
    </div>
    <div class="right">
        <h4>right</h4>
        <p>这是页面的右侧内容</p>
    </div>
</div>
<div class="footer">
    <h4>footer</h4>
</div>
</body>
</html>