What does the ">" (greater-than sign) CSS selector mean?

Viewed 238568

For example:

div > p.some_class {
  /* Some declarations */
}

What exactly does the > sign mean?

8 Answers

The greater sign ( > ) selector in CSS means that the selector on the right is a direct descendant / child of whatever is on the left.

An example:

article > p { }

Means only style a paragraph that comes after an article.

Related