I've read W3 spec on box model and behaviour of collapsing margins and tried to model different conditions when they collapse. But finally found this [article](https://www.sitepoint.com/web-foundations/collapsing-margins/) where everything already illustrated well.