Say I have a parent div. Inside, there are three child DIVs: header, content, and footer. The header is attached to the top of the parent and fills it horizontally. The footer is attached to the bottom of the parent and fills it horizontally. Content should fill the entire space between the header and footer.
The parent must have a fixed width and height. The contents of the DIV should fill all the free space between the header and footer. When the content content of the DIV exceeds the space between the header and footer, the content of the DIV should display scroll bars and allow scrolling so that the contents of the footer are never closed and the footer is obscure content.
Now comes the tricky part: you don't know the height of the header or footer in advance (for example, the header and footer are populated dynamically). How to post content without using JavaScript ?
Example:
<div style="position : relative; width : 200px; height : 200px; background-color : #e0e0ff; overflow : hidden;"> <div style="background-color: #80ff80; position : absolute; left : 0; right : 0; top : 0;"> header </div> <div style="background-color: #8080ff; overflow : auto; position : absolute;"> content (how to position it?) </div> <div style="background-color: #ff8080; position : absolute; bottom : 0px; left :0; right : 0;"> footer </div> </div>
To clarify this event , the target layout that I am trying to achieve will be used in a business application. The parent DIV will have a fixed but unknown size (for example, it will be exactly the size of the browser window, the size and size of the browser window by the user). Call the parent DIV screen.
The header will contain a set of filtering controls (such as text fields, drop-down lists and a filter button) that should be moved to the next line if there is not enough horizontal space (therefore, its height can change at any time to accommodate the breaking line). The title should always be visible and attached to the top on the screen.
The footer will contain a set of buttons, for example, in a dialog box. They can also be carried over to the next line if there is not enough space for horizontal display. The footer must be attached to the bottom of the "screen" to be accessible and visible at any time.
The content will contain the contents of the “screen”, such as dialog boxes, etc. If there are too few fields, the rest of the content will be “empty” (in this case, the footer should not start immediately after the content, but still attached to the bottom of the “screen”, which is a fixed size). If there are too many fields, the DIV content will provide a scroll bar for accessing hidden controls (in this case, the DIV content should not stretch below the footer, since the scroll bar will be partially hidden).
I hope this clarifies the issue once again, as my reputation is too low to introduce comments on your reps.