1. 程式人生 > >美妙的css--布局1

美妙的css--布局1

color span ng- pad adding padding -- abs wid

具體描述:右列定寬,左列自適應,窗口縮到一定程度左列寬度不變且出現滾動條。

題幹:

1 <div class="wrap">
2     <div class="left"></div>
3     <div class="right"></div>
4 </div>

方法1:

.wrap{
    position:relative;
    width:100%;
    min-width:1300px;
}
.left{
    min-width:1000px!important;
    position:absolute
; right:600px; background:red; height:500px; width:100%; } .right{ width:600px; height:500px; float:right; background:blue; }

方法2:

.wrap{
    position:relative;
    height:auto;
    padding-right:600px;
    min-width:1300px;
}
.left{
    background:red;
    height:500px;
}
.right{
    position
:absolute; right:0; width:600px; background:blue; }

美妙的css--布局1