Code Snippet
Force Vertical Scrollbar
html {
overflow-y: scroll;
}This is invalid CSS, but it works in everything except Opera. The reason for this is to prevent "centering jumps" when navigating back and forth between pages with enough content to have a vertical scroll bar and pages that do not.
There’s a specific one for Mozilla: overflow: -moz-scrollbars-vertical;
IE I think always shows the vert scroll bars
Hi there I like this new snippets area very useful !
Thanks for the visit and the kind comment.have a wonderful day
It works perfectly in Opera 11.01. Thanks for the tip!
PS: You have an awesome form.
This is great, but it creates a double scrollbar, doesn’t it?
Thanks, works a treat :)
W00t!
what about
height: 101% ?
this was an an advice published in the blog of a CSS professional.
i dont have the link, but you can seach in google for this code.
Chris; An inelegant solution. overflow-y:scroll; adds a disabled scrollbar if the page height or content size is less than, or becomes less than the browser size. height:101%; (and other similar solutions, like margin: 0,0,1px;) enable that scrollbar and lets the user scroll a few pixels. It may seem moot, but I like my scrollbars disabled when there’s no need to use them for scrolling purposes.
Thank you!
If this is invalid, someone should rethink what is valid again.
What do You think about this snippet: