The DOM Level 2 Style Sheet interfaces are base interfaces used to represent any type of style sheet. The expectation is that DOM modules that represent a specific style sheet language may contain interfaces that derive from these interfaces.
The interfaces found within this section are not mandatory. A DOM
application may use the hasFeature(feature, version) method
of the DOMImplementation interface with parameter values
"StyleSheets" 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 2 Core specification
This set of interfaces represents the generic notion of style sheets.
A style sheet can be associated with an HTMLDocument in one of two ways:
By creating a new LINK HTML element (see the
HTMLLinkElement interface in the
By creating a new STYLE HTML element (see the
HTMLStyleElement interface in the
Removing a LINK HTML element or a STYLE HTML element removes the underlying style sheet from the style sheet collection associated with a document. Specifically, the removed style sheet is no longer applied to the presentation of the document.
A new style sheet can be created and associated with an XML
document by creating a processing instruction with the target
'xml-stylesheet'
Removing a processing instruction with a target of 'xml-stylesheet'