Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ sidebar_position: 1
tags: [selector, combinator, descendant]
description: "Descendant selector is used to select an element that is a descendant of another element."
keywords: [descendant selector, css descendant selector, css selector, css combinator, css descendant combinator]
hide_table_of_contents: true
---

In CSS, the descendant selector is used to select an element that is a descendant of another element. The descendant selector is represented by a whitespace character (` `) between two selectors.

<AdsComponent />
<br />

## Syntax

Expand Down Expand Up @@ -57,6 +59,7 @@ The descendant selector can be used to select multiple levels of descendants. Fo
:::

<AdsComponent />
<br />

## Example: Using Descendant Selector

Expand Down Expand Up @@ -159,4 +162,4 @@ In the above example, the CSS rule will apply the color `blue` to the text insid
- [Adjacent Sibling Selector](#): The adjacent sibling selector selects an element that is immediately preceded by a specified element.
- [General Sibling Selector](#): The general sibling selector selects an element that is preceded by a specified element.
- [Attribute Selector](#): The attribute selector selects elements based on their attributes.
- [Pseudo-Class Selector](#): The pseudo-class selector selects elements based on their state or position.
- [Pseudo-Class Selector](#): The pseudo-class selector selects elements based on their state or position.