CSS布局實(shí)例代碼 兩列布局實(shí)例
發(fā)布時(shí)間:2009-11-25 00:11:07 作者:佚名
我要評(píng)論

CSS兩列布局,右側(cè)固定,左側(cè)自適應(yīng)寬度.
CSS兩列布局,右側(cè)固定,左側(cè)自適應(yīng)寬度
<div style="width:90%; margin:0 auto;">
<div style="width:200px; float:right;">這是右側(cè)的內(nèi)容</div>
<div style=" margin-right:210px;">這是左側(cè)的內(nèi)容,自適應(yīng)寬度</div>
</div>
CSS兩列布局,左側(cè)固定,右側(cè)自適應(yīng)寬度
<div style="width:90%; margin:0 auto;">
<div style="width:150px; float:left;>這是左側(cè)的內(nèi)容 固定寬度</div>
<div style=" margin-left:160px;>中間內(nèi)容,自適應(yīng)寬度</div>
</div>
CSS三列布局,左右寬度固定,中間自適應(yīng)寬度
<div style="width:90%; margin:0 auto;">
<div style="width:200px; float:right; >這是右側(cè)的內(nèi)容 固定寬度</div>
<div style="width:150px; float:left; >這是左側(cè)的內(nèi)容 固定寬度</div>
<div style=" margin-left:160px;margin-right:210px;>中間內(nèi)容,自適應(yīng)寬度</div>
</div>
三列等高布局
<style>
*{ margin:0; padding:0}
#content{overflow:hidden}
#content #left,#content #center,#content #right{margin-bottom:-10000px;padding-bottom:10000px;width:300px;float:left;}
#content #left{background:#f00;}
#content #center{background:#0ff}
#content #right{background:#f0f}
</style>
<div id="content">
<p id="left">left<br />left<br />left<br />left<br />left<br />left</p>
<p id="center">center</p>
<p id="right">right</p>
</div>
<div style="width:90%; margin:0 auto;">
<div style="width:200px; float:right;">這是右側(cè)的內(nèi)容</div>
<div style=" margin-right:210px;">這是左側(cè)的內(nèi)容,自適應(yīng)寬度</div>
</div>
CSS兩列布局,左側(cè)固定,右側(cè)自適應(yīng)寬度
<div style="width:90%; margin:0 auto;">
<div style="width:150px; float:left;>這是左側(cè)的內(nèi)容 固定寬度</div>
<div style=" margin-left:160px;>中間內(nèi)容,自適應(yīng)寬度</div>
</div>
CSS三列布局,左右寬度固定,中間自適應(yīng)寬度
<div style="width:90%; margin:0 auto;">
<div style="width:200px; float:right; >這是右側(cè)的內(nèi)容 固定寬度</div>
<div style="width:150px; float:left; >這是左側(cè)的內(nèi)容 固定寬度</div>
<div style=" margin-left:160px;margin-right:210px;>中間內(nèi)容,自適應(yīng)寬度</div>
</div>
三列等高布局
<style>
*{ margin:0; padding:0}
#content{overflow:hidden}
#content #left,#content #center,#content #right{margin-bottom:-10000px;padding-bottom:10000px;width:300px;float:left;}
#content #left{background:#f00;}
#content #center{background:#0ff}
#content #right{background:#f0f}
</style>
<div id="content">
<p id="left">left<br />left<br />left<br />left<br />left<br />left</p>
<p id="center">center</p>
<p id="right">right</p>
</div>
相關(guān)文章
- 這篇文章主要介紹了一文匯總 CSS 兩列布局和三列布局的具體使用,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小2020-06-28
CSS實(shí)現(xiàn)頁(yè)面兩列布局與三列布局的方法示例
這篇文章主要介紹了CSS實(shí)現(xiàn)頁(yè)面兩列布局與三列布局的方法示例,包括寬度與高度的自適應(yīng)的示例,需要的朋友可以參考下2016-06-23- 這篇文章主要介紹了CSS兩列布局實(shí)現(xiàn)方式總結(jié),討論了包括absolute + margin和float + margin方式的一些實(shí)踐和問(wèn)題,需要的朋友可以參考下2016-06-02
橫向兩列布局(左列固定,右列自適應(yīng))的4種CSS實(shí)現(xiàn)方式
這篇文章主要介紹了橫向兩列布局,即左列固定,右列自適應(yīng)的4種CSS實(shí)現(xiàn)方式,感興趣的小伙伴們可以參考一下2016-04-27學(xué)習(xí)DIV+CSS網(wǎng)頁(yè)布局之兩列布局
學(xué)習(xí)DIV+CSS網(wǎng)頁(yè)布局中的兩列布局,本文為大家分享的是DIV+CSS網(wǎng)頁(yè)布局教程的第二篇,感興趣的小伙伴們可以參考一下2016-03-15- CSS三列布局走出HTML布局陰影,兩端固定寬度,中間自適應(yīng)結(jié)構(gòu),下面有個(gè)不錯(cuò)的示例,大家可以參考下2014-02-27
- 在CSS面試題中經(jīng)常會(huì)遇到CSS兩列布局的問(wèn)題,下面給大家分享CSS兩列布局的實(shí)現(xiàn)方式,每種方法給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2021-07-27