Introduction CSS is damn hard. It's these small problems that will take up your entire day and energy and the will to live. And one such notorious problem has been to make a child element break out of their parent's padding. The problem I recently t...
Markdown supported · ⌘↵ to post
Angie Borucka
Hm, I double checked your website, and it doesn't look like there is a padding on that newsletter div. Also, 100vw wouldn't work on desktop, as it counts 100vw with the scrollbar width. In case of padding your 100% would be width minus the padding.
Try it ;) add padding to the main div you have there and check if your CSS still works - plot twist, it doesn't.
CSS is weird and I give you that, just please please pretty please, double check your "tutorials" before spreading the tip, that's actually not working.
Smarter solution for this kind of case is using negative margins and having width with
calc(100% + 2x your margin). Setting max width to100vwwould do the job on mobile devices tho, as there is no scroll space taken into an account when counting the viewport width.