I am using the gridster.js library to display a bunch of items in a grid-like manner on the page. This causes all items to have position:absolute
and a fixed height/width. Inside each item I want to have a header and a body so it looks like
-------------------
| header |
| |
-------------------
| |
| body |
| |
| |
| |
| |
--------------------
The problem is that I want the body
section to fill up the height of the parent completely and no overflow past it or come up short from it. What happens naturally is the height is exactly the height of its contents, so if theres only 1 word in the body then it will be only a few pixels tall, but if its a lot of content then it overflows past the parent element. What I want is for the body to "fill" up the container so I can add overflow-y:scroll
to the body and it will scroll just within the body section.
Is there a way to get this functionality given this scenario?
Example http://jsfiddle.net/np66ojub/