Click to return to the DHTML, HTML     
createRange Method     createTextNode Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

createStyleSheet Method


Creates a style sheet for the document.

Syntax

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

Parameters

sURLOptional. String that specifies how to add the style sheet 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.
iIndexOptional. Integer that specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection.

Return Value

Returns a styleSheet object.

Example

This example uses the createStyleSheet method to create a link to a style sheet.

document.createStyleSheet('styles.css');

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

document



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.