I always thought the underlying theory behind css margins was very simple. A div with a margin of 10px will create a 10px cushion around that element. When two divs are placed side by side, both with a 10px margin, it results in the divs being 20px apart; both elements have a 10px margin, resulting in 20px distance between the elements. This seems to be correct, and is what I have always believed as fact.
HOWEVER, I have recently discovered that if instead of the two divs being side by side, and place one under the other, the margin between the two elements is now only 10px. What happened to 10px margin given off by the other div? Why isn't there consistency between side by side and vertically stacked?
A margin essentially says "don't put anything within x pixels of me". By "anything", does this include the margins of other elements? In the case of side by side, the answer seems to be yes, the margin says "don't put anything, including your own margin, within x pixels of me". In the case of vertically, it seems to allow the latter?
Please can someone clarify so I can put it to bed and continue with my evening :)