CSS Descendant Selector

The CSS descendant selector is used to match the descendant elements of a particular element. The word Descendant indicates nested anywhere in the DOM tree. It can be a direct child or deeper than five levels, but it will still be referred to as a descendant.

The Descendant combinator is represented using a single space. It combines two selectors in which the first selector represents an ancestor (parent, parent's parent, etc.), and the second selector represents descendants. The elements matched by the second selector are selected if they have an ancestor element that matches the first selector. Descendant selectors use the descendant combinators.

Syntax

We can understand CSS descendant selector using the following example. Let us see the implementation of CSS descendant selector.

Example

Test it Now

Next TopicCSS calc()




Contact US

Email:[email protected]

CSS Descendant Selector
10/30