Descendant (space) combinator
Specifies an arbitrary ancestral relationship between selector elements.
![]() |
Syntax
first second { ... }
Parameters
- first
-
A CSS simple selector.
- second
-
A CSS simple selector.
Standards information
- CSS 2.1, Section 5.5
Remarks
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.
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 {}
Examples
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>
DIV.menu LI { font-size: x-small; }
</style>
