Krzysztof Jurewicz is a user on You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Krzysztof Jurewicz @KrzysiekJ

Today I learned that box model in is neither intuitive nor consistent. Margins of child elements may propagate to their parents due to margin collapsing rules. There seems to be no standard way to disable this behaviour, but it disappears in some circumstances, in particular if the parent has non-zero padding set. Therefore setting a padding to 1px can impact element’s positioning, much more than by 1px.

More about this: