Within my div
, I have a layout consisting of a header, textarea, and footer. The header and footer adjust their size based on content, while the textarea fills the remaining space. To ensure the textarea does not exceed 100% height, I set its max-height to be 100%. However, when resizing the textarea, it can expand beyond the parent's 100%. How can this issue be resolved?
View the code here: http://jsfiddle.net/FC7eY/1650/
Key Points:
- The cumulative heights of all elements should equal 100%
- The height of the
textarea-wrapper
div should be calculated astotalHeight(100%) - headerHeight - footerHeight
- The header and footer sizes are dynamic and depend on content
- The parent/wrapper div must have a height of 80% and a width of 350px