Hi, I'm Jacob. Enjoying devFlipCards? Buy me a coffee

12. What are the differences between classes and IDs in CSS?

  • Class: Used for styling groups of elements. Can be used multiple times in a document. Identified by "." (dot).
  • ID: Used for styling a unique element. Can be used only once in a document. Identified by "#" (hash).
/* Examples */ .myClass { color: red; /* Class - can be used multiple times */ } #myId { color: blue; /* ID - should be unique */ }
Struggling to find common date to meet with your friends? Try our new tool
commondate.xyz