Я бы хотел, чтобы контейнер flexbox занимал доступное пространство под контейнером заголовка с неизвестной высотой.Столбцы внутри контейнера, которые превышают доступное пространство, должны прокручиваться.Я продемонстрировал желаемый результат в Fiddle .
Fiddle использует следующую строку для вычисления доступного пространства.
height: calc(100vh - 4em);
Это проблема, потому что a)заголовок не всегда 4em, и b) vh не учитывает полосы прокрутки.
* {
box-sizing: border-box;
}
div {
border: 1px solid #000;
}
.header {
background: #ededed;
}
.flex-container {
display: flex;
background: #CCC;
height: calc(100vh - 3em);
/* remove line to see outcome w/o sketchy calculation */
}
.column {
min-width: 9em;
width: 9em;
background: #fff;
overflow-y: auto;
}
<div class="header">
I'm a header
</div>
<div class="flex-container">
<div class="column">
Some content
</div>
<div class="column">
more content
</div>
<div class="column">
So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content
it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable
So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more
content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's
unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable
So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more
content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's
unbelievable So much more content it's unbelievable So much more content it's unbelievable So much more content it's unbelievable
</div>
<div class="column">
</div>
<div class="column">
Some content
</div>
</div>