in HTML by
Q:
What is the difference between classes and IDs in CSS?

▼ Show 1 Answer

0 votes
by
  • IDs — Meant to be unique within the document. Can be used to identify an element when linking using a fragment identifier. Elements can only have one id attribute.

  • Classes — Can be reused on multiple elements within the document. Mainly for styling and targeting elements.

HTML
Learn More with Madanswer

Related questions

0 votes
asked Aug 17, 2020 in HTML by RShastri
0 votes
asked Aug 17, 2020 in HTML by RShastri
+1 vote
...