* Each element in a document has padding, a border and an invisible margin around it.
* If the padding is set to 1em above and below, a space of 2ems will exist between each element.
* However, if the margin above and below each element is set to 1em, only a space of 1em will exist between the elements.
* This is because the top margin for the second element moves up and overlaps the bottom margin of the first element - this is called collapsing margins.
* The second margin moves up til it touches the border of the first element but no further.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment