码迷,mamicode.com
首页 > Web开发 > 详细

美妙的css--布局1

时间:2017-08-29 20:41:15      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:relative   col   log   height   pre   class   布局   imp   span   

具体描述:右列定宽,左列自适应,窗口缩到一定程度左列宽度不变且出现滚动条。

题干:

 

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

标签:relative   col   log   height   pre   class   布局   imp   span   

原文地址:http://www.cnblogs.com/sunny123-/p/7449971.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!