css布局系列——双飞翼布局

双飞翼布局是一种三列布局,两边定宽,

STEP1:DOM struction,the struction and the holy grail mode are the  same except the center column wraps a new element

<div id="header"></div>
     <div id="container">
         <div id="center" class="column">
             <div id="maincenter"></div>
        </div>
        <div id="left" class="column"></div>
        <div id="right" class="column"></div>
     </div>
<div id="footer"></div>

STEP2:We improve the css  on the basis of the holy grail css

  • remove :

1.relative position

2.padding of container 

  • add:

marging of wrapped element

   body {
      min-width: 550px;  /* 2x LC width + RC width */
    }
    #container .column {
      float: left;
    }
    #container {
    }
    #center {
      background: #D6D6D6;
      width: 100%;
    }
    #left {
      background: #77BBDD;
      width: 200px;
      margin-left: -100%  ;
    }
    #right {
      width: 150px;
      background: #FF6633;
      margin-left: -150px;
    }
    #maincenter{
      margin-left: 200px;
      margin-right: 150px;
    }

 

转载于:https://www.cnblogs.com/gongOnTheWay/p/4825237.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值