• <tbody id="9je1r"></tbody><tbody id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></tbody>
      • <acronym id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></acronym>

        亚洲无码Aⅴ,视频1页精品,欧美系列一区二区,曰韩色999

        兩列布局(一列定寬,一列自適應,列等高)

        2016/9/18 8:50:01   閱讀:1414    發(fā)布者:1414

        結構:

        1    <div class="parent"> 
        2         <div class="left"> 
        3             <p>left</p> 
        4         </div> 
        5         <div class="right"> 
        6             <p>right</p> 
        7             <p>right</p> 
        8         </div> 
        9     </div>

        1.用table+table-cell實現(xiàn)兩列布局(一列定寬,一列自適應,且table是自動的兩列自動等高)

         1 .parent { 
         2         background-color: grey; 
         3         width: 500px; 
         4         height: 300px; 
         5         padding: 10px; 
         6         box-sizing: border-box; 
         7  
         8         display: table; 
         9         table-layout: fixed; 
        10         table-layout: fixed;/*加速table的渲染,實現(xiàn)布局優(yōu)先*/ 
        11     } 
        12     .left { 
        13         display: table-cell; 
        14         width: 100px; 
        15  
        16         background-color: skyblue; 
        17         border-right: 10px solid transparent; 
        18         background-clip: padding-box;/*設置背景的顯示位置*/ 
        19     } 
        20     .right { 
        21         display: table-cell; 
        22         background-color: greenyellow; 
        23     }

        2. 使用flex進行兩列布局(一列定寬,一列自適應,列等高),flex的align-item屬性默認值是stretch.

         1 .parent { 
         2         background-color: grey; 
         3         width: 500px; 
         4         height: 300px; 
         5         padding: 10px; 
         6  
         7         display: flex; 
         8     } 
         9     .left { 
        10         width: 100px; 
        11         margin-right: 10px; 
        12         background-color: skyblue; 
        13     } 
        14     .right { 
        15         flex: 1; /* 填充剩余部分 */ 
        16         background-color: greenyellow; 
        17     }

        3.使用float(偽等高)

         1 .parent { 
         2         background-color: grey; 
         3         width: 500px; 
         4         height: 300px; 
         5         padding: 10px; 
         6  
         7         overflow: hidden;/*截斷*/ 
         8     } 
         9     .left,.right { 
        10         padding-bottom: 99999px; 
        11         margin-bottom: -99999px; 
        12     }/*登高*/ 
        13     .left { 
        14         width: 100px; 
        15         background-color: skyblue; 
        16         margin-right: 10px; 
        17         float: left; 
        18          
        19     } 
        20     .right { 
        21         overflow: hidden; 
        22         background-color: yellowgreen; 
        23     }

         

        亚洲无码Aⅴ,视频1页精品,欧美系列一区二区,曰韩色999
            • <tbody id="9je1r"></tbody><tbody id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></tbody>
            • <acronym id="9je1r"><acronym id="9je1r"><rp id="9je1r"></rp></acronym></acronym>
              安吉县| 阿坝| 姚安县| 祥云县| 邮箱| 西乌珠穆沁旗| 六枝特区| 容城县| 托里县| 侯马市| 沅陵县| 乡城县| 石泉县| 汉源县| 林西县| 中江县| 泰州市| 通化县| 建瓯市| 山丹县| 景谷| 广元市| 抚远县| 石台县| 芒康县| 富平县| 河北省| 安顺市| 潞西市| 修文县| 吐鲁番市| 克什克腾旗| 汪清县| 宾川县| 宽甸| 通海县| 云南省| 苗栗市| 尚志市| 临沧市| 固镇县|