468,133 Members | 1,509 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

positioning a scrolled DIV after fluid content?

Hi,

I have a div with fluid content, below which I want a scrollable div.
I can't work out how to style the scrollable div to say "use the rest
of the space in the container".

The best I can come up with is having the scrollable div abolutely
positioned as in my demo, but this is horrible as it doesn't follow
the fluid stuff.

Demo here:

http://www.thebunnyshed.co.uk/test.htm

Jun 5 '07 #1
1 1768
On 2007-06-05, lister <li************@hotmail.comwrote:
Hi,

I have a div with fluid content, below which I want a scrollable div.
I can't work out how to style the scrollable div to say "use the rest
of the space in the container".

The best I can come up with is having the scrollable div abolutely
positioned as in my demo, but this is horrible as it doesn't follow
the fluid stuff.
I can't see a way of doing it without resorting to a table (or obviously
JavaScript but in my opinion using JS for layout is worse than using
tables for layout).

If you don't mind setting the height of .container to something (rather
than setting bottom) then it's possible.

What you want is for the computed value of top for .container to be its
"static position" which means the position where it would have gone if
it hadn't been positioned, which is just under the <h1>.

That is possible if you set top to auto, but you also need to set bottom
to auto. Otherwise the computed value for top is based on bottom and the
height. If bottom is auto, you will need to set the height, or it will
be based on the content, which will be far too high.
Demo here:

http://www.thebunnyshed.co.uk/test.htm
Jun 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Anna | last post: by
9 posts views Thread by Bryan R. Meyer | last post: by
5 posts views Thread by Neal | last post: by
22 posts views Thread by Jam Pa | last post: by
12 posts views Thread by JB | last post: by
4 posts views Thread by Alan Silver | last post: by
1 post views Thread by chris f | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.