How to Completely Disable Horizontal Scrolling on Your Website?
How to Completely Disable Horizontal Scrolling
To physically disable the horizontal scroll feature on your webpage, follow these steps:
-
CSS Rule in HTML Tag:
- In the tag, specify both max-width: 100%; and overflow-x: hidden; CSS rules to ensure that the page cannot exceed the width of the browser window and that horizontal scrolling is disabled.
-
Complete CSS Code:
<code class="css">html, body { max-width: 100%; overflow-x: hidden; }</code>
Copy after login -
Implementation:
- Include the CSS code in an external stylesheet or add it to the