How to hide the scrollbar?


I would like to remove my scrollbar from the user's view, as I do not currently know that when an error is marked, a box appears above my form and therefore moves some pixels to my form and that in this movement where the scrollbar horizontal at the bottom of my form appears, I would like to know if there is a way to hide the scrollbar , so that it is no longer visible.

Example image:

asked by David 18.03.2017 в 00:31

4 answers


You can do it with CSS with overflow: hidden;

answered by 18.03.2017 / 00:32

You can use the overflow: hidden; attribute to hide the scroll bar horizontal and vertical .

If you only want to hide your horizontal scroll bar, you can use the overflow-x: hidden; attribute or for the vertical overflow-y: hidden; case.

answered by 21.03.2017 в 22:35

It is true that with overflow: hidden; it can be resolved, but I think it is not the correct method, since in this way you are disabling the scroll within that < strong> <div> but in your case it does not matter since it is not necessary to do scroll , but ... what would happen if you add more content and you need to scroll ? strong> and at the same time hide the scroll bar ?

With the following CSS style, you solve it:

::-webkit-scrollbar {
    display: none;

This will hide all the scrollbars, but then if you want you can apply that style to just one element with an id or a class.

I hope it helps you

answered by 21.03.2017 в 15:49

To remove the vertical scroll, put this code in your style.css file You will not need JavaScript. Try it:

  overflow-x: hidden;
  font-family:'Opens Sans',helvetica;  
  margin: 0px;
  padding: 0px;
answered by 26.11.2017 в 08:02