I have the following layout, everything is full height but the columns (.col
) are fluid, and I don’t want them to exceed the parent height (which is 100%
).
Is there any way to add scrolling and (auto max-height) to the article
element inside the container?
In short, I want the column to be full height and the article to become scrollable if his height is bigger than .col
height.
Thank you!
3
Answers
Just set the
height
toauto
for wrap div element. If you set it to 100% it means that the component would have 100% height of its parent. And in your case, the parent is the window.Setting it to
auto
means it will have the height of its children.Try using height:auto in the .wrap class like this:
You can calculate all the other content height and subtract it from the total viewport height and assign it to the
article
height.