CSS Descendant Combinator ( )

Definition and Usage

CSS Descendant Combinator (A simple space) is used to select elements within an element.

If an element matched by the second selector has an ancestor (parent element, parent's parent element, grandparent element, etc.) that matches the first selector, then these elements will be selected.

Example

Select and set the style for all <p> elements within <div> elements:

div p {
  background-color: yellow;
{}

Try It Yourself

CSS Syntax

element1 element2 {
  CSS Declarations;
{}

Technical Details

Version: CSS1

Browser Support

Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Related Pages

CSS Tutorial:CSS descendant selector