I am trying to stack two elements vertically with each element having dynamic heights.
The first element will be fixed at the top and the second element will have overflow and I want it to be scrollable but the height of the first element is unknown.
So lets say the first element could be a height of anywhere between 100 and 150 pixels. The height of the second element would need to be 100% minus the height of the first element.
So how do I have both elements to be dynamic without having to fix the height of the first element.
#element-1
width: 100%
min-width: 300px
height: 150px
#element-2
width: 100%
min-width: 300px
height: calc(100% - 150px)
overflow-y: auto
-webkit-overflow-scrolling: touch
I have this and it works but if element 1 is less than 150px then I have this unwanted dead space between the two elements.