Skip to content

08. Class vs ID Selectors

martin@mustbebuilt.co.uk edited this page Sep 3, 2024 · 2 revisions

The main difference between ID and class selectors is that ID selectors are only supposed to be used once per document.

They can be used on any HTML element in the document but should only appear once. In the example above a rule is declared for a section of the document that will be identified as the footer of the file and styled accordingly.

Clone this wiki locally