If you shorten the width of the window or check on mobile, there is a horizontal scroll, breaking the layout.
I believe most probably navigation is causing this, but no clue how. Tried everything from setting width/max-width
to 100%, overflow: hidden
, etc.
Can someone help how to resolve this?
2
Answers
Will fix your issue. It’s caused by your container padding (5rem horizontal), which is quite a lot for a mobile view because although it’s a relative unit, it’s not relative to viewport width. You could use something like
padding: 3rem clamp(1rem, 5vw, 5rem);
instead so that the padding is responsive.So it seems to be caused by padding in these 2 places
One tip you could use to find the place that is overflowing is to put this code at the top of your file
This will add an red outline to every object so you can see them quicker