rule object
[This documentation is preliminary and is subject to change.]
Represents a style within a style sheet that consists of a selector and one or more declarations.
Standards information
There are no standards that apply here.
Remarks
The rule object defines a set of Cascading Style Sheets (CSS) attributes applied to a set of HTML elements. For example, a rule consisting of the selector H1 and the declaration font-family:Arial defines all H1 elements to render in the Arial font.
Examples
This example uses a rule object consisting of the selector H1 to define a single rule that changes the H1 headings in a document to red.
<STYLE>
H1 { color: red }
</STYLE>
If the style sheet containing the preceding rule is the first style sheet in the document, the following code returns the rule object associated with the rule.
oRule=document.styleSheets(0).rules(0)
See also
Build date: 3/14/2012