前端之-三列布局。顶部-底部-中间两侧固定。中间内容自适应

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        body{margin: 0px;padding: 0px;}
        .top{height: 100px;width:100%;float:left;background-color:gray;}
        .main{height: 800px;width:100%; margin: 0 auto;background-color: yellow;float:left;}
            .left{width: 100px;height:800px;background-color: blue;position: absolute;top: 100;left: 0;}
            .middle{width:100%;height:800px;background-color: red;margin: 0 100px 0 100px;position: absolute;top: 100;}
            .right{width: 100px;height:800px;background-color: blue;position: absolute;top: 100;right: 0;}
        .footer{height: 60px;width:100%;float:left;background-color:green;}
    </style>
</head>
<body>
<div class="top" >TOP</div>
<div class="main" >
    <div class="left">LEFT</div>
    <div class="middle" >MIDDLE</div>
    <div class="right">RIGTH</div>
</div>
<div class="footer">
    FOOTER
</div>
</body>
</html>
原文地址:https://www.cnblogs.com/haoliansheng/p/6867505.html