how to remove horizontal scrollbar in html page code example

Example 1: DISABLE the Horizontal Scroll

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

Example 2: hide horizontal scrollbar css

.x-scroll-disabled {
	overflow-x: hidden;
}

Example 3: remove horizontal scrollbar css

overflow-x: hidden;

Example 4: css stop scrollbar

html {
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

html::-webkit-scrollbar {
    width: 0px; /* For Chrome, Safari, and Opera */
}

Example 5: how to remove horizontal scrolling

/* this works for vertical scrolling also

this is useful for those who can't use overflow: hidden or any other solution
because the css on the website changes in someway */

::-webkit-scrollbar:horizontal {
  display: none;
}

Tags:

Css Example