Specifies an arbitrary ancestral relationship between selector elements.
Syntax
| HTML | E F { sRules } |
| Scripting | N/A |
Possible Values
| E | String that specifies the name of a document language element type or simple selector. |
| F | String that specifies the name of a document language element type or simple selector. |
| sRules | String that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs. |
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.
Note Descendant combinators were called contextual selectors in Cascading Style Sheets (CSS), 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.
Example
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>
Standards Information
See Also