- default margin on the top and bottom of text elements (headings, paragraphs, lists), is equal to the font-size.
- (for h1 it's actually a little bit smaller, but it's close enough)
- Whenever two margins touch each other, they will collapse into one single margin instead of two of them which push against one another
- To center something horizontally on the screen use
auto
margin, likesection { margin: 0 auto; }
- Select multiple elements with comma
h1, h3, p { margin-top: 0; }
- Last selector wins, so p font-size would be 20px in this example: