我需要有一个100%高度的flexbox,只有一个50像素的儿童页脚。
是否可以不进行计算(100%-50px)?
以下是我的尝试:
body, html{
height:100%;
}
.container {
height: 100%;
display: flex;
flex-direction: column;
background-color:red;
}
.flex-1 {
background-color: yellow;
}
.flex-A {
background-color: blue;
display: flex;
flex-direction: column;
height: 100%;
}
.flex-1-child {
background-color: purple;
overflow-y: auto;
height: calc(100% - 50px);
}
.flex-2-child {
background-color: green;
height: 50px;
}
.text{
height: 500px;
}
<div class="container">
<div class="flex-1">test</div>
<div class="flex-A">
<div class="flex-1-child">
<div class="text">test2</div>
</div>
<div class="flex-2-child">
<div>test</div>
</div>
</div>
</div>
我没有100%的身高。
谢谢你的帮助。