+1 vote
in HTML by
What is the difference between classes and IDs in CSS?

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.

Related questions

0 votes
asked Aug 17, 2020 in HTML by RShastri
0 votes
asked Aug 17, 2020 in HTML by RShastri
+1 vote
0 votes
asked Nov 20, 2020 in JQuery by sharadyadav1986
...