> (greater-than sign) is a CSS Combinator.
A combinator is something that explains the relationship between the selectors.
A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.
There are four different combinators in CSS3:
descendant selector (space)
child selector (>)
adjacent sibling selector (+)
general sibling selector (~)
Note: < is not valid in CSS selectors.
For example:
div > p {
background-color: yellow;
}
Paragraph 1 in the div.
Paragraph 2 in the div.
Paragraph 3 in the div.
Paragraph 4. Not in a div.
Paragraph 5. Not in a div.
Output: