469,929 Members | 1,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Div with dynamic height and scrolling content

I have a page with a content-div that scrolls and has a dynamic height.
I do this with position absolute, top and bottom. I can do this if the
other parts (divs) in the page over the scrolling part has the same
height-unit. To get the top value I add all the other heights together.
E.g. 2em + 1em + 3em = 6em.

Is it possible to accomplish this with parts having different
height-units (one is in %, another is in px and so on)? I know I can
fix this with a table.

Can I use bottom and right on a position-relative element?

The page:
http://www.freewebs.com/hasodaki/ScrollingContent.html (there may be a
publicity banner on top)

Nov 29 '06 #1
2 9058
ha***********@spray.se wrote:
I have a page with a content-div that scrolls and has a dynamic height.
I do this with position absolute, top and bottom. I can do this if the
other parts (divs) in the page over the scrolling part has the same
height-unit. To get the top value I add all the other heights together.
E.g. 2em + 1em + 3em = 6em.

Is it possible to accomplish this with parts having different
height-units (one is in %, another is in px and so on)? I know I can
fix this with a table.
How would you add px and em for instance, where px is absolute and em
depending on browser setting and/or text zoom level? Seems contradictory.

Why do you use/want/need absolute positioning?
>
Can I use bottom and right on a position-relative element?
I wouldn't know why not. You?
>
The page:
http://www.freewebs.com/hasodaki/ScrollingContent.html (there may be a
publicity banner on top)
FWIW, I did not see a banner. Does this happen only occasionally? How
does that affect your pixel-perfect layouts?

HTH
Sh.
Nov 29 '06 #2

Schraalhans Keukenmeester skrev:
ha***********@spray.se wrote:
I have a page with a content-div that scrolls and has a dynamic height.
I do this with position absolute, top and bottom. I can do this if the
other parts (divs) in the page over the scrolling part has the same
height-unit. To get the top value I add all the other heights together.
E.g. 2em + 1em + 3em = 6em.

Is it possible to accomplish this with parts having different
height-units (one is in %, another is in px and so on)? I know I can
fix this with a table.

How would you add px and em for instance, where px is absolute and em
depending on browser setting and/or text zoom level? Seems contradictory.

Why do you use/want/need absolute positioning?
Do you have an answer or not? Do you know if it's possible? If so -
how?
Why or why not I want to mix px, % or em is not inportant!
Or have you not understood my question?

Can I use bottom and right on a position-relative element?

I wouldn't know why not. You?
Have a sample url. As I see it it doesn't work with position-relative.

The page:
http://www.freewebs.com/hasodaki/ScrollingContent.html (there may be a
publicity banner on top)

FWIW, I did not see a banner. Does this happen only occasionally? How
does that affect your pixel-perfect layouts?
If you didn't see it it's good!
HTH
Sh.
Nov 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Secret Guy | last post: by
8 posts views Thread by Serge Hartmann | last post: by
3 posts views Thread by Ryan Dahl | last post: by
6 posts views Thread by Martin Plotz | last post: by
4 posts views Thread by reycri | last post: by
1 post views Thread by knkk | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.