Skip to content

Try our new Crash Courses!

Become a member using the button below to hide this banner and gain access to our new Crash Courses.

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 Reference > CSS Selectors