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 descendant – CSS



To select a descendant of an HTML element, use 2 selectors separated by a space (the first selector represents the parent element and the second selector represents the descendant):

.my-class p {



The descendant combinator selects all descendants that match the selector, not just immediate children.


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


Descendant combinator on MDN

Back to: CSS Course > CSS Selectors