For a simple chat application, I thought of using this simple layout:
*----------------------------------*
|<div> |
| |
| |
| |
+----------------------------------+
|<input type text> |Send|
+----------------------------------+
i.e., at the bottom we have a form consisting of a textfield for typing in messages as well as a button for sending them. The rest of the screen shall be a <div> where the messages are shown. The <div> should take up the remaining space, and the textfield should stretch horizontally.
My main problem is stretching the div. No matter what I do, it doesn’t seem to stretch. I’ve tried setting height to 100%, tried to position is absolute, but didn’t help. Any ideas?
If you place the form inside the div and set them both to absolute, that should do it… This works in Chrome, haven’t tested elsewhere:
HTML:
CSS: