createStyleSheetcreateStyleSheet*
*



Contents  *



Index  *Topic Contents
*Previous Topic: createRange
*Next Topic: createTextRange

createStyleSheet

Description

Creates a style sheet for the document.

Syntax

object.createStyleSheet(url, index)

ParameterDescription
url Optional string that indicates 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.
index Optional integer 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 a styleSheet object.

Example

To create a link to a style sheet

document.createStyleSheet('styles.css');

To add style sheet to the style object

document.createStyleSheet(document.body.style.backgroundColor='blue'); 

Applies To

document


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.