Descendant Combinator

Descendant (space) combinator

Specifies an arbitrary ancestral relationship between selector elements.

CSS 2.1, Section 5.5



first second { ... }



A CSS simple selector.


A CSS simple selector.

Standards information


A descendant combinator is white space that separates two simple selectors. A selector of the form "E F" matches element F when it is an arbitrary descendant of some ancestor element E.

Note  Descendant combinators were called contextual selectors in Cascading Style Sheets, Level 1 (CSS1).

To skip over a generation of elements and pass styles to descendants beyond child elements, combine the Universal (*) Selector with the Descendant Combinator. For example, the following selector matches any p elements that are not direct descendants (grandchildren or later) of a div element.

DIV * P {}


The following style rule applies only to li elements within a div with a class of menu. Note that the selected elements do not have to be a direct descendant of the div tag.

<style> LI { font-size: x-small; }



© 2015 Microsoft