🎯 CSS Class 2 – Advanced Selectors

1️⃣ Basic Selectors Review

Element selector applies style to all <p> tags.

Class selector targets .note

ID selector targets #unique

2️⃣ Combinator Selectors

This is inside a <div> (descendant selector)

Child span (div > span)

This paragraph follows the above heading (adjacent sibling)

Heading 3

This paragraph follows h3 (general sibling ~)

This is another paragraph after h3 (also affected by ~)

3️⃣ Attribute Selectors

Normal Link (href)
Opens in New Tab (target="_blank")



4️⃣ Pseudo-Classes

Hover on the links below 👇

Hover Me! | And Me!

This is the first child paragraph.

This is the middle paragraph.

This is the last child paragraph.

5️⃣ Pseudo-Elements

This paragraph demonstrates ::first-line and ::first-letter pseudo-elements. Select and highlight text to see the ::selection effect.

✨ Experiment with each selector to see how they work! ✨