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.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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