DEV Community

Discussion on: How can I style an element based on multiple factors in CSS?

Collapse
 
moopet profile image
Ben Sinclair

It's whitespace that's important:

  • button.specialButton - a button with the class specialButton
  • button .specialButton - any element with the class specialButton that's anywhere inside a button.
  • button#verySpecialButton - a button with the id verySpecialButton
  • button #verySpecialButton - any element with the id button that's anywhere inside a button.