• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
阳光般的温暖
博客园    首页    新随笔    联系   管理    订阅  订阅
美妙的css--布局1

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

题干:

 

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;
}

 

posted on 2017-08-29 19:44  阳光般的温暖  阅读(251)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3