1、flex实现tab固定底部
tab固定底部一直以来使用fixed进行固定定位,下面是flex实现:
<div class="main">
<div class="haeder"></div>
<div class="footer"></div>
</div>
html,
body {
height: 100%; // 必须
}
.main
height: 100%; // 必须
width: 100%;
display: flex;
flex-direction: column;
}
.haeder {
flex: 1;
overflow: auto; /* 必须 */
}
.footer {
width: 100%;
height: 50px;
background-color:red;
}
网友评论