CSS – Hide broswer scrollbar

I am working on a website with content flying from the left to the center. When the animation starts, the horizontal scroll bar is shown and then disappeared as the animation completed. This causes a little shake on the content movement. A simple workaround is to disable the horizontal scroll bar by setting the body overflow-x to hidden.

body {
  overflow-x: hidden;
}

 

Done =)

Reference: StackOverflow – Disable browsers vertical and horizontal scrollbars

4 thoughts on “CSS – Hide broswer scrollbar”

  1. That’s not too good to use this style with whole HTML body.
    I prefer you always use DIV and apply the CSS style to the DIV.

    Maybe you can come up with an example with both HTML markup and CSS.

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.