1

I am removing horizontal scroll bar completely from bottom. I tried this below ways.

1st way

Hide html horizontal but not vertical scrollbar

This way is working when the page is first loaded. But when I click on the UI. Bottom scroll bar is appeared but not scrollable and disabled. So UI shrinks slightly and disabled scrollbar is shown at the bottom.

2nd way

::-webkit-scrollbar {
    display: none;
}
::-moz-scrollbar {
    display: none;
}
::-o-scrollbar {
    display: none;
}

This removed all scroll bar from UI. Not even the vertical scroll bar is shown. Even onclick, neither vertical nor horizontal scroll bar is shown.

Is there a way to remove horizontal scroll bar completely in this way ?Not even shown when the UI is clicked.

Community
  • 1
  • 1
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372

1 Answers1

4

By bottom scroll-bar, I assume you are referring to the horizontal scrollbar. This appears when you have content that overlaps the width of your element.

As a best practice, you should align your content so it's viewable without horizontal scrolling. You might even want to include some padding to make it easier on the eyes.

But if it's required, you can set the overflow-x property and set to hidden.

With the hidden property, the content is clipped, scrolling is disabled and the scrollbar doesn't appear.

http://www.w3schools.com/cssref/css3_pr_overflow-x.asp

Richard Hamilton
  • 25,478
  • 10
  • 60
  • 87