View Full Version : always display scrollbar
I'm going to be dynamically adding content to a page that will start as only around 600px tall, but eventually become a lot longer. I'd like to display the scrollbar at all times because when the content gets too long, the display shifts as the scrollbar pops up... Is this possible, or am I going to have to throw a tantrum? :mad:
kapaha
08-31-2006, 01:34 PM
I do not recommend usage of the following solution to this problem, as it is, um, IE ONLY! But it shall remain here for the benefit of those who don't mind.
I'm not sure if it will work or if it is quite correct CSS, but try adding "overflow-x:hidden;overflow-y:scroll;" to the body element in your CSS. You could give it a go.
This edit used to say that it wouldn't work. But it did work. So, um, it now says this, instead.
Strangely enough, it did work. Thanks!
Tantrum avoided.
kapaha
08-31-2006, 01:47 PM
Oh, right. I'll take down that edit.
RysChwith
08-31-2006, 04:26 PM
Correction: it worked in IE. Overflow-x and overflow-y are IE-proprietary properties. For other browsers, you'll likely have to make the page artificially tall in the beginning. You can try adding min-height: 101% to the body. You might also need to add height: 100% to the html element. IE should ignore these, so you should be fine between the two of them.
Rys
kapaha
08-31-2006, 04:32 PM
They are? I didn't know. I should have tested it, considering I use Firefox, I would have noticed. Best not to use that, as IE only stuff is nonsense.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.