fight with container div and scroll bar

i have a simple page layout, all contained in a container div. all is good (html and css validate - no errors)

the problem is when the page extends down and a scrollbar appears, my container div shifts over about 10 pixels in FF, opera, etc. Doesn't happen with IE

is there anyway to prevent the div from shifting over to the left when the scrollbar appears? the left and right margins for the container div are set to auto currently

help!well you have to understand that there is no scroll bar unless the page overflows... you have some options...

you could set the page to overflow: hidden, but it wouldn't make much sense seeing is how you have overflow now anyways you will probably have it in the future and with this, it won't be seen...

or figure out a way (probably js) to see how tall your container div is and if it is larger than the users resolution apply a margin-right of 10px to it... not too sure if it would work, but it may...=

i don't think it is something you have to worry about though, but if you are doing a page where no scroll will every be needed then just use the overflow method... like if you were doing a huge flash movie or whatever...

ie constantly has the scroll bar there, but it isn't always highlighted...interesting, good info. i played around with some stuff, i think i'll just probably leave it as is. given most of the sites users will probably come via IE they're never really notice anyhow. will bug me til i die (or forget in a few days) though

thanks again
 
Back
Top