实现效果
我刚开始想到的思路是 左边内容使用浮动 右边自适应
<div class="center_container clearfix">
<div class="left_list">
<p class="active_pp">数据统计</p>
<p>标准规范</p>
</div>
<div class="right_list">
右边内容
</div>
</div>
.center_container{
width: 1200px;
margin:0 auto;
height: 100%;
}
.left_list{
float:left;
height: 100%;
min-height: calc(100vh - 330px);
min-height: -moz-calc(100vh - 330px);
min-height: -webkit-calc(100vh - 330px);
width: 240px;
background-color:#ffffff;
padding-top: 32px;
box-sizing: border-box;
}
.left_list p{
height: 58px;
line-height: 58px;
font-size: 16px;
color: #333333;
text-align: center;
}
.right_list{
background-color:#ffffff;
height: 100%;
min-height: calc(100vh - 330px);
margin-left: 256px;
padding: 30px 40px;
box-sizing: border-box;
}
这样写完 实现了默认内容区域铺满全屏了 但是!!!!!当右边的内容超出默认高度之后 高度变高了 左边浮动栏 不会自适应变高~ 很难受
然后 我使用了第二个办法 成功解决 那就是使用 position定位
<div class="center_container">
<div class="left_list">
<p class="active_pp">数据统计</p>
<p>标准111</p>
</div>
<div class="right_list">
右边内容区
</div>
</div>
.center_container{
width: 1200px;
margin:0 auto;
position: relative;
height: 100%;
}
.left_list{
position: absolute;
height: 100%;
min-height: calc(100vh - 330px);
min-height: -moz-calc(100vh - 330px);
min-height: -webkit-calc(100vh - 330px);
width: 240px;
background-color:#ffffff;
padding-top: 32px;
box-sizing: border-box;
}
.left_list p{
height: 58px;
line-height: 58px;
font-size: 16px;
color: #333333;
text-align: center;
}
.right_list{
background-color:#ffffff;
height: 100%;
min-height: calc(100vh - 330px);
margin-left: 256px;
padding: 30px 40px;
box-sizing: border-box;
}
至此完美解决~
完结撒花~~