Martin
Martin

Reputation: 149

How to avoid horizontal scroll without overflow-x: hidden

I'm having an issue with my website: www.csselectronics.com I have set up an overflowing background on my main page. As a result I get an overflow situation when viewing the site on mobile - i.e. it is possible to horizontally scroll to the right, which I'd like to avoid.

To fix this I've tried using solutions that employ the overflow-x: hidden; feature in the html and body - but when doing so, I encounter some other issues with my hosted platform.

Is there another way to solve this than by using the overflow-x: hidden trick?

Thank you!

Martin

Upvotes: 0

Views: 940

Answers (2)

Yehuda Solomont
Yehuda Solomont

Reputation: 118

Instead of overflowing the background, I would try using:

background-size: cover;

Or

background-size: contain;

Upvotes: 1

Sandro
Sandro

Reputation: 1061

Yes you can solve this by using responsive design and ensuring that no element overflows 100% of your layout.

Upvotes: 0

Related Questions