CSS element>element Selector

❮ Previous Selectors Next ❯

Example

div > p {
  background-color: red;
}

Meaning

The element>element selects direct descendents.

This selector matches all elements that are the immediate children of a specified element.

The combinator in a child selector is a greater-than sign (>).

Note: The selector may be surrounded by whitespace characters.

Version: CSS2




Standard Syntax

element > element {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯