I’m currently faced with the typical horizontal scroll issue. On the page “Doing Good”, I have a custom infinite slider which caused the page to have a horizontal scroll (this is clearly shown on the published site).
I don’t know how to solve this as having the page body overflow: hidden would cut off all my overflowing elements on all pages.
I tried this and there is no longer any horizontal scroll (yay). However, now every elements in that page is stretched out to the entire website and there were no margin (image 1)
I think the problem arise as I have my body margin 10vw so that every section is spaced in. When the style is width 100%, I think it override the 10vw margin and sketch everything out. When I set the width as 80%, I saw that the overflow elements is also cut off. You can check the other pages to see what I mean as I’m not sure how best to describe the layout. I have kept the “Doing good” page with the fixed setting you suggested for comparison.
Is there any other way to have all the overflow elements stay the same without cutting them off when removing the horizontal scroll?
Correct, this is where your design needs fixed. You’re wanting your slider section to go to the edges of the page, but most sections to be 80vw.
Normally the way you’d do this is by designing your page using a section and container concept so that you have margin and padding control per-section, rather than forcing it page-wide.
Personally I [almost] never put a class on the body element. Everything is at the section and container level.
If you’re still familiarizing yourself with HTML layouts and the box model, the Webflow U has some great tutorials with walkthroughs that will help you understand the pieces you’re building with more deeply.
Thank you for your help. I have change the back to the default body and apply it at the section level. The custom property you suggested then worked perfectly!