Specifies a direct descendant 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 child combinator is a "greater-than sign" (>) character that separates two simple selectors. Whitespace is not significant. A selector of the form "E>F" matches when element F is a direct descendant of element E.
Note Requires Windows Internet Explorer 7 or later.
Note Combinators are enabled only in standards-compliant mode (strict
!DOCTYPE).
Example
The following style rule matches only P elements that are immediate children of the BODY element.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<style>
BODY > P { line-height: 1.3; color: red;}
</style>
</head>
<body>
<p>Paragraph one</p>
<div><p>Paragraph two</p></div>
<p>Paragraph three</p>
</body>
</html>
Standards Information
See Also