remove horizontal scroll css 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: how to stop a page from scrolling horizontally

overflow-x: hidden

Example 5: 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 6: how to remove horizontal scroll on elementor

(function (debug) {
    var w = debug.documentElement.offsetWidth,
        t = debug.createTreeWalker(debug.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
        if (b.right > w || b.left < 0) {
            t.currentNode.style.setProperty('outline', '1px dotted red', 'important');
            console.log(t.currentNode);
        }
    };
}(document));