DHTML Methods
DOM Level 2 Specification.
Creates a style sheet for the document.
oStylesheet = document.createStyleSheet (
[ sURL ] [ , iIndex ] )
sURL |
Optional. String indicating how the style sheet is to be added to the document. If a file name is specified for the URL, the style information will be added as a LINK object. If the URL contains style information, this information will be added to the STYLE object. |
iIndex |
Optional. Index indicating where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style at the end of the collection. |
Returns the new styleSheet object.
This method is Microsoft's® implementation of the generic createCSSStyleSheet interface provided for in the DOM.
The following code creates a link to a style sheet.
document.createStyleSheet ( 'styles.css' );
document