Is it possible to set a vertical scroll on a container with unknown height using flexbox?
I can not use max-height
as it will limit the hei
flex
has some short comings/bugs/flaws, or what ever to call them, and need an inner absolute element to force the scroll.
html, body{
height: 100%;
overflow: hidden;
}
.list{
display: flex;
flex-direction: column;
height: 100%;
}
header {
flex: 0;
}
.vertical {
flex: 1;
position: relative;
}
.scroll {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: auto;
}
Some header
- Item1
- Item2
- Item3
- Item4
- Item5
- Item6
- Item7
- Item8
- Item9
- Item10
- Item11
- Item12
- Item13
- Item14
- Item15
- Item16
- Item17
- Item18
- Item19
- Item20
- Item21
- Item22
- Item23
- Item24
- Item25
- Item26
- Item27
- Item28