CSS Selector Level 2 » Child combination

This child combination selector will match child elements which are direct children of the first selector.

# Syntax

Copy
E > F {
    /* declarations */
}

# Example

Copy
div > span {
    color: red;
}

The first inner <span> inside the <div> will be red because it's a direct child; the inner inner <span> will not be matched.

Try example in CodePen

# Browser support

Platform Chrome Firefox Safari Edge Internet Explorer Opera
Desktop Yes (1) Yes (1) Yes (1.3) Yes (12) Yes (7) Yes (9.2)

Please wait a moment, the comments start loading now...
explorermozillachromesafariopera info external