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:
I’m using this to force the scroll bar:
html {heigth: 100%; margin-bottom: 1px}
Quite similar to Phillips solution.
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.