Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

Select a child – CSS



To select an immediate child of an HTML element, use 2 selectors separated by a greater than sign (the first selector represents the parent element and the second selector represents the immediate child):

.my-class > p {



The child combinator will only select elements that are immediate children of the parent element that match the selector specified.


Recreate the CSS code from the Demo section in your CSS file.


Child combinator on MDN

Back to: CSS Course > CSS Selectors