Home >> Tutorials/FAQs >> CSS Tutorials >> Index
CSS Tutorials - Why Is the Top Margin Not Showing
(Continued from previous topic...)
Why Is the Top Margin Not Showing?
If you are expecting a top margin to show up, and it is not showing up,
it's probably because of the vertical margins collapsed due the following rules:
- Between two block elements - The bottom margin of the upper element and the top margin
of the lower element are collapsed into one. The taller element wins. One margin will not show up.
- Between a parent element and a child element - The top padding of the parent element and
the top margin of the child element are collapsed into one. The taller element wins. The padding or the margin will not show up.
(Continued on next topic...)
- How Many Ways Can Elements Relate to Each Other?
- How In-line Elements Are Formatted Side by Side?
- How Nested Block Elements Are Formatted?
- How Two Block Elements Are Formatted as a Stack?
- How Floating Elements Are Formatted?
- Why Is the Top Margin Not Showing?
- How Are Vertical Margins between Two Block Elements Collapsed?
- How Are Parent Padding Spaces Collapsed with the Child Margins?
- How Is the Width of a Parent Element Related to Child Elements?
- How Is the Full Width of a Block Element Extended?
- How To Test Child Full Width Extension?
- How To Test Parent Content Width Extension?
- What Are White Spaces in HTML Documents?
- How White Spaces Are Formatted?
- What Happens to Multiple White Spaces in In-line Elements?