CSS Advanced Selectors

Kelly Obrazcova
Jul 24, 2017 · 1 min read
  1. Elements li { }
  2. Class .class { }
  3. ID #name { }
  4. Star — selects everything on the page *{ }
  5. Descendant Selector-selects all selectors nested within an element li a { }
  6. Adjacent Selector- h4 + ul { }
  7. Attribute Selector — a href[http://www.url.com] { }, input[type=”text”] { }
  8. nth of Type — ul:nth-of-type(3){}, ul:nth-of-type(even){}

specificity — (1) type selectors(li), (2) class/atribute/pseudo-class selectors (hover), (3) ID

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade