asp.net.ph

Skip Navigation Links

createStyleSheet Method

DHTML Methods


DOM Level 2 Specification.

Creates a style sheet for the document.

Syntax

oStylesheet = document.createStyleSheet ( 
   [ sURL ] [ , iIndex ] ) 
Parameters

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.

Return Value

Returns the new styleSheet object.

Remarks

This method is Microsoft's® implementation of the generic createCSSStyleSheet interface provided for in the DOM.

Example

The following code creates a link to a style sheet.

document.createStyleSheet ( 'styles.css' );
Applies To

document



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note