• <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

        左右定寬,中間自適應(yīng),實(shí)現(xiàn)三列布局

        2016/11/21 8:32:05   閱讀:2284    發(fā)布者:2284

        左右定寬,中間自適應(yīng),實(shí)現(xiàn)三列布局

        今天想說的是一個(gè)左右定寬,中間自適應(yīng),實(shí)現(xiàn)三列布局,我也總結(jié)了以下,主要有以下幾種:
        廢話不多說,直接上代碼:

        第一種:float

        <!--html--> 
        <div id="left"><span>left</span></div> 
        <div id="right"><span>right</span></div> 
        <div id="middle"><span>middle</span></div>
        //css 
        #left{ 
            float: left; 
            background-color: red; 
            width: 150px; 
            height: 50px; 
        } 
        #right { 
            float: right; 
            background-color: yellow; 
            width: 200px; 
            height: 50px; 
        } 
        #middle { 
            margin: 0 200px 0 150px; 
            width: 100%; 
            background-color: #fff9ca; 
            height: 50px; 
        }

        第二種:BFC

        <!--html--> 
        <div id="left"><span>left</span></div> 
        <div id="right"><span>right</span></div> 
        <div id="middle"><span>middle</span></div>
        //css 
        #left { 
            background-color: red; 
            width: 150px; 
            height: 50px; 
            float: left; 
        } 
        #right { 
            background-color: yellow; 
            width: 200px; 
            height: 50px; 
            float: right; 
        } 
        #middle { 
            background-color: #fff9ca; 
            height: 50px; 
            overflow: hidden; 
        }

        第三種:雙飛翼布局

        <!--html--> 
        <div class="grid"> 
            <div id="middle"> 
                <div id="middle-span"><span>middle</span></div> 
            </div> 
            <div id="left"><span>left</span></div> 
            <div id="right"><span>right</span></div> 
        </div>
        //css 
        #middle { 
            float: left; 
            background-color: #fff9ca; 
            width: 100%; 
            height: 50px; 
        } 
        
        #middle-span { 
            margin: 0 200px 0 150px; 
        } 
        
        #left { 
            float: left; 
            position: relative; 
            background-color: red; 
            width: 150px; 
            margin-left: -100%; 
            height: 50px; 
        
        } 
        
        #right { 
            float: left; 
            position: relative; 
            background-color: yellow; 
            width: 200px; 
            margin-left: -200px; 
            height: 50px; 
        }

        第四種:flex

        <!--html--> 
        <div class="flex"> 
            <div id="left"><span>left</span></div> 
            <div id="middle"><span>middle</span></div> 
            <div id="right"><span>right</span></div> 
        </div>
        //css 
                .flex { 
                    display: flex; 
                    flex-flow: row; 
                } 
        
                #left { 
                    background-color: red; 
                    width: 150px; 
                    height: 50px; 
                } 
        
                #middle { 
                    background-color: #fff9ca; 
                    flex: 1; /* flex中寬度自適應(yīng)使用該屬性,使用100%時(shí)其他列的固定寬度會出現(xiàn)問題*/ 
                    height: 50px; 
                } 
        
                #right { 
                    background-color: yellow; 
                    width: 200px; 
                    height: 50px; 
                }
        亚洲无码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>
              台中县| 江津市| 杭锦旗| 新乐市| 南郑县| 桃园县| 清河县| 靖西县| 高清| 吉首市| 黄陵县| 石柱| 乌恰县| 涪陵区| 嫩江县| 芜湖县| 广水市| 固始县| 和龙市| 正镶白旗| 禄丰县| 耿马| 旅游| 昭苏县| 宁海县| 嘉定区| 焦作市| 龙山县| 曲周县| 杭锦后旗| 林西县| 麻栗坡县| 白玉县| 铜川市| 正蓝旗| 康乐县| 武清区| 鄱阳县| 安多县| 吴桥县| 家居|