The DOM Level 2 Cascading Style Sheets (
The CSS interfaces are organized in a logical, rather than
physical structure. A collection of all style sheets
referenced by or embedded in the document is accessible on
the document interface. Each item in this collection exposes
the properties common to all style sheets referenced or embedded
in HTML and XML documents; this interface is described in the
For each CSS style sheet, an additional interface is exposed - the
CSSStyleSheet interface. This interface allows access to
the collection of rules within a CSS style sheet and methods to modify
that collection. Interfaces are provided for each specific type of rule
in CSS2 (e.g. style declarations, @import rules, or
@font-face rules), as well as a shared generic
CSSRule interface.
The most common type of rule is a style declaration. The
CSSStyleRule interface that represents this type of rule
provides string access to the CSS selector of the rule, and access to the
property declarations through the CSSStyleDeclaration
interface.
Finally, an optional CSS2Properties interface is described;
this interface (if implemented) provides shortcuts to the string
values of all the properties in CSS level 2.
All CSS objects in the DOM are "live", that is, a change in the style sheet is reflected in the computed and actual style.
The interfaces within this section are considered fundamental CSS interfaces, and must be supported by all conforming implementations of the CSS module. These interfaces represent CSS style sheets specifically.
A DOM application may use the hasFeature(feature, version)
method of the DOMImplementation interface with parameter
values "CSS" and "2.0" (respectively) to determine whether or not this
module is supported by the implementation. In order to fully support this
module, an implementation must also support the "Core" feature defined
defined in the DOM Level 2 Core specification
The interface found within this section are not mandatory. A DOM
application may use the hasFeature(feature, version) method
of the DOMImplementation interface with parameter values
"CSS2" and "2.0" (respectively) to determine whether or not this module
is supported by the implementation. In order to fully support this
module, an implementation must also support the "CSS" feature defined
defined in