成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

CSS三列布局

兩側(cè)定寬中間自適應(yīng)布局

思路一:  float

創(chuàng)新互聯(lián)公司2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、外貿(mào)營銷網(wǎng)站建設(shè)網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元扶溝做網(wǎng)站,已為上家服務(wù),為扶溝各地企業(yè)和個人服務(wù),聯(lián)系電話:18982081108

【1】float + margin + calc

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.right{float: left;width: 100px;}.center{float: left; width:calc(100% - 240px);margin: 0 20px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>    
    <div class="right"  >
        <p>right</p>
    </div>        </div>

CSS三列布局

【2】float + margin + (fix)

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.right{position: relative;float: left;width: 100px;}.centerWrap{float: left; width:100%; margin: 0 -100px;}.center{margin: 0 120px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>            
    <div class="centerWrap" >
        <div class="center" >
            <p>center</p>
            <p>center</p>
        </div>        
    </div>
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路二: inline-block

【1】inline-block + margin + calc

CSS三列布局

<style>p{margin: 0;}.parent{font-size: 0;}.left,.right,.center{display:inline-block; vertical-align: top;font-size: 16px;}.left,.right{width: 100px;}.center{width: calc(100% - 240px); margin: 0 20px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>        
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

【2】inline-block + margin + (fix)

CSS三列布局

<style>p{margin: 0;}.parent{font-size: 0;}.left,.right,.centerWrap{display:inline-block; vertical-align: top;font-size: 16px;}.left,.right{width: 100px;position:relative;}.centerWrap{width: 100%; margin: 0 -100px;}.center{margin: 0 120px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="centerWrap" >
        <div class="center" >
            <p>center</p>
            <p>center</p>
        </div>        
    </div>        
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路三: table

CSS三列布局

<style>p{margin: 0;}.parent{display: table; width: 100%;table-layout: fixed;}.left,.right,.centerWrap{display:table-cell;}.left,.right{width: 100px;}.center{margin: 0 20px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="centerWrap" >
        <div class="center" >
            <p>center</p>
            <p>center</p>
        </div>        
    </div>        
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路四: absolute

CSS三列布局

<style>p{margin: 0;}.parent{position: relative;height:40px;}.left,.right,.center{position: absolute;}.left{left: 0;width:100px;}.right{right: 0;width: 100px;}.center{left: 120px; right: 120px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>                
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路五: flex

CSS三列布局

<style>p{margin: 0;}.parent{display: flex;}.left,.right{width: 100px;}.center{flex: 1; margin: 0 20px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>                
    <div class="right"  >
        <p>right</p>
    </div>            </div>

CSS三列布局

 

兩列定寬一側(cè)自適應(yīng)布局

這種布局與單列定寬單列自適應(yīng)布局非常相似

思路一: float

【1】float + margin

缺點是IE6-瀏覽器的3px的bug,以及當(dāng)自適應(yīng)列中有元素清除浮動時,會使該元素不與左側(cè)浮動元素同行,從而出現(xiàn)文字下沉現(xiàn)象

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.center{float: left;width: 100px;margin-right: 20px;}.right{margin-left: 240px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>                
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>            </div>

CSS三列布局

【2】float + margin + calc

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.center{float: left;width: 100px;margin-right: 20px;}.right{float: left; width: calc(100% - 240px);}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>                
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>            </div>

CSS三列布局

【3】float + margin + (fix)

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.center{position: relative; float: left;width: 100px;margin-right: 20px;}.rightWrap{float: left; width: 100%; margin-left: -240px;}.right{margin-left:240px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="rightWrap">
        <div class="right"  >
            <p>right</p>
            <p>right</p>
        </div>            
    </div>            </div>

CSS三列布局

 【4】float + overflow

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.center{position: relative; float: left;width: 100px;margin-right: 20px;}.right{overflow: hidden;zoom:1;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                        </div>

CSS三列布局

 

思路二: inline-block

【1】inline-block + margin + calc

CSS三列布局

<style>p{margin: 0;}.parent{font-size: 0;}.left,.right,.center{display:inline-block; vertical-align: top;font-size: 16px;}.left,.center{width: 100px;margin-right:20px;}.right{width: calc(100% - 240px);}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                        </div>

CSS三列布局

【2】inline-block + margin + (fix)

CSS三列布局

<style>p{margin: 0;}.parent{font-size: 0;}.left,.rightWrap,.center{display:inline-block; vertical-align: top;font-size: 16px;}.left,.center{position: relative;width: 100px;margin-right:20px;}.rightWrap{width:100%; margin-left: -240px;}.right{margin-left: 240px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>    
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="rightWrap" >
        <div class="right"  >
            <p>right</p>
            <p>right</p>
        </div>        
    </div>            </div>

CSS三列布局

 

思路三: table

CSS三列布局

<style>p{margin: 0;}.parent{display: table; width: 100%;table-layout: fixed;}.leftWrap,.centerWrap,.right{display:table-cell;}.leftWrap,.centerWrap{width: 120px;}.left,.center{margin-right: 20px;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="leftWrap">
        <div class="left" >
            <p>left</p>
        </div>        
    </div>
    <div class="centerWrap">
        <div class="center" >
            <p>center</p>
        </div>        
    </div>
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路四: absolute

CSS三列布局

<style>p{margin: 0;}.parent{position: relative;width:100%;height:40px;}.left{position: absolute;left:0;width:100px;}.center{position: absolute;left:120px;width: 100px;}.right{position: absolute;left:240px; right:0;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>        
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>            </div>

CSS三列布局

 

思路五: flex

CSS三列布局

<style>p{margin: 0;}.parent{display: flex;}.left,.center{width:100px;margin-right:20px;}.right{flex:1;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>        
    <div class="center" >
        <p>center</p>
    </div>        
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>            </div>

CSS三列布局

 

中間定寬兩側(cè)自適應(yīng)布局

思路一: float

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left{float: left;margin-right: 20px;}.center{float: left;width: 100px;margin-right: 20px;}.right{overflow: hidden;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
        <p>left</p>
    </div>        
    <div class="center" >
        <p>center</p>
    </div>    
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路二: table

CSS三列布局

<style>p{margin: 0;}.parent{display: table; width: 100%;}.leftWrap{display: table-cell; width: 0.1%;}.centerWrap{display: table-cell;width: 120px;}.left,.center{margin-right: 20px;}.right{display:table-cell;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="leftWrap">
        <div class="left" >
            <p>left</p>
            <p>left</p>
        </div>            
    </div>
    <div class="centerWrap">
        <div class="center" >
            <p>center</p>
        </div>            
    </div>
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路三: flex

CSS三列布局

<style>p{margin: 0;}.parent{display: flex;}.left{margin-right: 20px;}.center{width: 100px;margin-right: 20px;}.right{flex: 1;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
    </div>            
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

一側(cè)定寬兩列自適應(yīng)布局

思路一: float

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left{float: left;width: 100px;margin-right: 20px;}.center{float: left;margin-right: 20px;}.right{overflow: hidden;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>            
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路二: table

CSS三列布局

<style>p{margin: 0;}.parent{display: table; width: 100%;}.leftWrap{display: table-cell; width: 120px;}.centerWrap{display: table-cell;width: 0.1%;}.left,.center{margin-right: 20px;}.right{display:table-cell;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="leftWrap">
        <div class="left" >
            <p>left</p>
        </div>            
    </div>
    <div class="centerWrap">
        <div class="center" >
            <p>center</p>
            <p>center</p>
        </div>            
    </div>
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路三: flex

CSS三列布局

<style>p{margin: 0;}.parent{display: flex;}.left{width: 100px;margin-right: 20px;}.center{margin-right: 20px;}.right{flex: 1;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>            
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

三列自適應(yīng)布局

思路一: float

CSS三列布局

<style>p{margin: 0;}.parent{overflow: hidden;}.left,.center{float: left;margin-right: 20px;}.right{overflow: hidden;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>            
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路二: table

CSS三列布局

<style>p{margin: 0;}.parent{display: table; width: 100%;}.leftWrap,.centerWrap{display: table-cell;width: 0.1%;}.left,.center{margin-right: 20px;}.right{display:table-cell;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="leftWrap">
        <div class="left" >
            <p>left</p>
            <p>left</p>
        </div>            
    </div>
    <div class="centerWrap">
        <div class="center" >
            <p>center</p>
            <p>center</p>
        </div>            
    </div>
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

思路三: flex

CSS三列布局

<style>p{margin: 0;}.parent{display: flex;}.left,.center{margin-right: 20px;}.right{flex: 1;}</style>

CSS三列布局

CSS三列布局

<div class="parent" >
    <div class="left" >
        <p>left</p>
        <p>left</p>
    </div>            
    <div class="center" >
        <p>center</p>
        <p>center</p>
    </div>            
    <div class="right"  >
        <p>right</p>
        <p>right</p>
    </div>                    </div>

CSS三列布局

 

本文標(biāo)題:CSS三列布局
路徑分享:http://jinyejixie.com/article6/igojig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)品牌網(wǎng)站設(shè)計、網(wǎng)站設(shè)計網(wǎng)站建設(shè)、網(wǎng)站排名、網(wǎng)站營銷

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)
肥城市| 长宁县| 田阳县| 洞头县| 乌审旗| 南川市| 温泉县| 扬州市| 靖州| 宣城市| 江北区| 钟山县| 伊吾县| 定兴县| 神池县| 营口市| 新乐市| 伊吾县| 江北区| 肇州县| 敦煌市| 咸丰县| 吉水县| 贵德县| 汉川市| 宁蒗| 垫江县| 抚松县| 安龙县| 嘉善县| 弥渡县| 侯马市| 涟源市| 疏勒县| 黄骅市| 荆州市| 隆林| 灵寿县| 连云港市| 张掖市| 黎城县|