双飞翼布局

发布于:2022-07-26 ⋅ 阅读:(314) ⋅ 点赞:(0)

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>双飞翼布局</title>
        <style type="text/css">
            *{
                margin: 0;
                padding: 0;
            }
            .header,.footer{
                width: 100%;
                height: 200px;
                background-color: aquamarine;
            }
            .container{
                width: 100%;
                overflow: auto;
            }
            .container>div{
                float: left;
            }
            .left{
                width: 200px;
                height: 300px;
                background-color: chartreuse;
                margin-left: -100%;
            }
            .right{
                width: 300px;
                height: 300px;
                background-color:#55aaff;
                margin-left: -300px;
            }
            .midder{
                width: 100%;
                height: 300px;
                background-color: bisque;
            }
            .text{
                margin-left: 200px;
            }
        </style>
    </head>
    <body>
        <div class="header">头部</div>
        <div class="container">
            <div class="midder"><div class="text">文本</div></div>
            <div class="left">左</div>
            <div class="right">右</div>
        </div>
        <div class="footer">底部</div>
        <!-- 中间自适应,两边定宽 -->
    </body>
</html>