CSSCSS · Lesson 02

Selectors

Type, class, id, attribute, grouping and combinators.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
3/3
SelectorMatches
pevery <p>
.cardelements with class card
#mainthe element with id main
[type="text"]attribute match
a, buttongrouping — both
div pany p inside a div (descendant)
div > pdirect children only
h2 + pthe p immediately after an h2
h2 ~ pall sibling p after an h2
Try it yourself

Knowledge check

0/1 answered

What does div > p select?