首页双翼圣杯布局

首页布局   2024-07-20 11:23   106   0  
<!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">
    <title>Document</title>
    <style>
        body {
            min-width: 550px;      /* 2x LC width + RC width */
        }
        #container {
            padding-left: 200px;   /* LC width */
            padding-right: 150px;  /* RC width */
        }
        #container .column {
            height: 200px;
            position: relative;
            float: left;
        }
        #center {
            background-color: #e9e9e9;
            width: 100%;
        }
        #left {
            background-color: red;
            width: 200px;          /* LC width */
            right: 200px;          /* LC width */
            margin-left: -100%;
        }
        #right {
            background-color: blue;
            width: 150px;          /* RC width */
            margin-right: -150px;  /* RC width */
        }
        #footer {
            clear: both;
        }
        #header, 
        #footer {
            background-color: #c9c9c9;
        }

        /*** IE6 Fix ***/
        * html #left {
            left: 150px;           /* RC width */
        }
    </style>
</head>
<body>
    <div id="header">#HEADER</div>
    <div id="container">
        <div id="center" class="column">#center</div>
        <div id="left" class="column">#left</div>
        <div id="right" class="column">#right</div>
    </div>
    <div id="footer">#FOOTER</div>
</body>
</html>