I want a div with minimum height of 290PX. When the content inside the div exceeds the height of 290px, the DIV should increase the height to 600PX, If the content still exceeds 600PX, add a scrollbar. :)
The content will arrive dynamically from backend.
Summary: Fix height to 290PX or 600Px depending upon content. Codepen and jsFiddle will be appreciated :)
Alkshendra Maurya
Frontend Engineer | Hashnode Alumnus
You can calculate the height of the contents using javascript and add a class to your div to override the height in the CSS.
in jQuery, outerHeight gives you the height of the element including the margins.
So you can do something like this:
where .bigger class would have the override style.
See pen: codepen.io/alkshendra/pen/PZpvMO