CSS布局-两边固定,中间自适应

直接上代码

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <script src="js/jquery-1.7.2.min.js"></script>
    <title></title>
    <style type="text/css">
        *{ margin:0; padding:0px;}
        .header{ background:#666; text-align:center;}
        .body{ overflow:hidden;*zoom:1;}
        .wrap-2{ margin-top:30px;}
        .wrap-2 .main-2{ float:left; width:100%;margin-bottom:-3000px; padding-bottom:3000px;background:#F90;}
        .wrap-2 .main-wrap-2{  margin:0 200px 0 150px;  }
        .wrap-2 .sub-2{ float:left; margin-left:-100%; width:150px; background:#6C0; margin-bottom:-3000px; padding-bottom:3000px;}
        .wrap-2 .extra-2{ float:left; margin-left:-200px; width:200px; background:#F9F; margin-bottom:-3000px; padding-bottom:3000px;}
        .footer{ background:#666; text-align:center;}
    </style>



<body>


<div class="wrap-2">
    <div class="header">Header</div>
    <div class="body">
        <div class="main-2"><div class="main-wrap-2"><p>main-wrap</p><p>main-wrap</p></div></div>
        <div class="sub-2"><p>sub</p><p>sub</p><p>sub</p></div>
        <div class="extra-2"><p>extra</p><p>margin-left:350px; background:#CC0;margin-left:350px; background:#CC0;</p></div>
    </div>
    <div class="footer">Footer</div>
</div>


</body>


</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值