views:

2184

answers:

2

I have a element on my form that looks like this:

<div style="overflow-y:auto;overflow-x:hidden;height:100%;width:100%">

In IE7 when the page first renders, there are no scrollbars. However, if I resize the page (even just 1 pixel) the scroll bars appear properly.

Is there something I can do so that the scrollbars show properly when the page first displays?

+2  A: 

Set overflow-y to "scroll" if you always want a scrollbar.

happytime harry
I could do that, but I only want the scrollbar to show if it's necessary.
DaveK
is there overflowing content when the page is first rendered?
happytime harry
Yes, the page that loads initially is larger than the container and should cause an overflow.
DaveK
is content added to the div after it would have been parsed (the inline css interpreted)?
happytime harry
A: 

you should add margin-right: 20px to your style, so the scrollbar will have enoguh place to be displayed.

Snus