A <div>
is a block-level element, often used to group sections of a page.
A <span>
is an inline element used to style part of a sentence, like
this highlighted text.
We use classes (with a period `.`) to style multiple elements consistently.
This paragraph uses the .highlight
class.
We use IDs (with a hash `#`) for unique elements.
#unique-id
.This paragraph is a direct child of the container div and is styled using the .container > p
selector.
This paragraph is inside another div and is not affected by the child selector.