HomeThe ClassicsFarai's Codelab

Things I Wish I’d Known About CSS

Published:

See Things I Wish I’d Known About CSS on cssfordesigners.com

Some CSS things you should know. Big ones are:

  • ::before/::after need content. Heydon suggests adding something like this to the default stylesheet:
    *::before, *::after {
        content: '';
    }
    
  • Use relative units everywhere and,
  • Margins collapse into the size of the bigger margin.

Read the article for more.