If you own a website and you are working for its presentation to be the best, but the site has a horizontal scroll issue that you want to fix or remove. So, that the user can only scroll the site in the vertical direction, not in the horizontal one. So, you are at the right place.\r\n\r\nHorizontal scroll in a web page or site does not seem to be good and also interrupts the user experience. This is much common in the mobile view of the site, whether it's a static or responsive site. Well, we have pointed out the reasons for this and the solutions below.\r\n
Reasons for Horizontal scroll on Website
\r\nHorizontal scroll in a website or webpage can occur for various reasons. And it can occur on any site for different reasons.\r\nBad CSS
\r\nCSS is responsible for all the orientations and presentations of the webpage. And if you are not familiar with the CSS then you might mess it with the additional CSS option in your CMS or theme customizations. Well, in this case, make sure to remove the CSS that you have just added to your site theme.\r\nOnly remove the CSS that you have added recently with regards to the width or height of any element.
\r\nIf you considered and found that your site CSS is not good and causing the horizontal scrolling, then use the below CSS in the additional CSS or add via theme editor.\r\n\r\nTry this CSS and check -\r\nhtml, body{\r\nwidth:100%;\r\noverlow-x:hidden;\r\n}\r\nImage Size
\r\nImages are responsible for the horizontal scroll in most cases. Most of the themes are responsible nowadays which automatically adjusts the width of the images according to the device-width with respect to its aspect ratio. But for some responsive sites too, the images can be adjusted in a manner that tends the horizontal scroll.\r\n\r\nIf the horizontal scroll is caused by image size issue, then add the below CSS to fix it.\r\nimg{\r\ndisplay:flex;\r\n}\r\nThe display flex makes the image to be flexible according to the device screen which makes them responsive too, and counter the horizontal scroll.\r\n