The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

#4: Forcing Scrollbars: Eliminating “Horizontal Jumps”

In this screencast I talk about how to force vertical scrollbars onto websites. Without doing this, pages with centered content can appear to "jump" to the left or right when going from a page that needs to vertically scroll to one that does not (and visa versa). I cover two different major techniques for doing this, since they both have their advantages and disadvantages between different browsers.

Links from video:


  1. Todd
    Permalink to comment#

    It’s nice to look through your screencast archives and come across something really simple but also something that has confused me for a long time. I knew this was possible but just couldn’t for life of me work out how it was done. Thanks

  2. Tav
    Permalink to comment#

    Thank you very much ! Good to know those tips. Greetings from Romania

    Permalink to comment#

    Thank you, it’s really a good video. But I’m wondering is it really a big deal for the little jump of the content =P

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in in triple backtick fences like this:

  function example() {
    element.innerHTML = "<div>code</div>";

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed