selectorA > selectorB {
    /* ... */
}
div > p {
    background-color: yellowgreen;
}
article {
    border: 1px dashed red;
}
<h2>CSS Child Combinator</h2>
<p>This is a p element.</p>
<div>
    <p>Selects all target direct child p elements of the preceding div element.</p>
    <p>Selects all target direct child p elements of the preceding div element.</p>
    <article>
        <h3>article</h3>
        <p>The grandchild p element is not selected.</p>
    </article>
</div>
Rendered Output
span {
    background-color: aqua;
}
div > span {
    background-color: gold;
}
<div>
    <span>
        This is a span element that is a direct child of div.
        <span>This is a span element that is a grandchild of div.</span>
    </span>
</div>
<span>This span element is unrelated to div.</span>
Rendered Output
/* Whitespace before and after the greater-than sign (>) is optional,
   but recommended for visual clarity. */

div>span { /* Not recommended */
    background-color: gold;
}
div > span { /* Recommended */
    background-color: gold;
}
selectorA selectorB {
    /* ... */
}
div p {
    background-color: yellowgreen;
}
div article {
    border: 1px dashed red;
}
<h2>CSS Descendant Combinator</h2>
<p>This is a p element.</p>
<div>
    <p>Selects all target descendant p elements of the preceding div element.</p>
    <p>Selects all target descendant p elements of the preceding div element.</p>
    <article>
        <h3>article</h3>
        <p>
            Also selects the descendant p element nested inside article,
            which is a grandchild of the preceding div element.
        </p>
    </article>
</div>
Rendered Output