Descendant

Specifies a relationship between an ancestor selector element and a descendent element (child, grandchild, great-grandchild, etc).

EF {sRules }

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 sheet property/value pairs.

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.

Ee371306.alert_note(en-us,Expression.30).gifNote:

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

The Universal selector can be combined with the descendant combinator to skip over a generation of elements and pass styles to descendants beyond those of the child elements. For example, the following selector matches any P elements that are grandchildren or later descendants of a DIV element. (Note that the whitespace is the combinator, and not part of the universal selector.)

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>
    div.menu li {font-size: x-small;}
</style>

Community Additions

ADD
Show: