侧边栏高度随中间内容高度自适应
文章目录
- 经常看见一个管理系统右侧边栏,要使得侧边高度随着和中间内容增多而增高。如图:
实现css代码:
/* 父元素 */
.wrap {
overflow: hidden;
}
/* 左侧分栏 */
.left {
width: 200px;
background: #f00;
float: left;
margin-bottom: -3000px;
padding-bottom: 3000px;
}
/*中间内容区域*/
.center {
height: 500px;
background: #00f;
margin: 0 10px;
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论