This interface provides access to an object that represents a single style sheet in the document.
addImport Adds a style sheet to the imports collection for the specified style sheet. addRule Creates a new rule for a style sheet. cssText Gets or sets the persisted representation of the style rule. disabled Sets or retrieves a value that indicates whether the user can interact with the object. href Sets or retrieves the URL of the linked style sheet. id Sets or retrieves the string identifying the object. imports Retrieves a zero-based collection of all the imported style sheets defined for the given styleSheet object. An imported style sheet is one that is brought into the document using the Cascading Style Sheets (CSS) @import rule. media Gets or sets the media type. owningElement Retrieves the next object in the HTML hierarchy. parentStyleSheet Retrieves the style sheet that imported the current style sheets. readOnly Retrieves whether the rule or style sheet is defined on the document or is imported. removeImport Removes the imported style sheet from the imports collection based on ordinal position. removeRule Deletes an existing style rule for the styleSheet object, and adjusts the index of the rules collection accordingly. rules Retrieves a collection of rules defined in the styleSheet. If there are no rules, the length of the collection returned is zero. title Sets or retrieves the title of the style sheet. type Retrieves the CSS language in which the style sheet is written.
The style sheet object is used to retrieve information about a style sheet. For example, you can use it to retrieve the URL of a style sheet's source file, and to retrieve the element in the document that defines the style sheet. You can then use the style sheet object to modify the document's style sheet.
You can retrieve a pointer to the style sheet object using the IHTMLDocument2::styleSheets method. You can also retrieve a collection of all IHTMLStyleSheetsCollection in the document using the IHTMLStyleSheet::imports method. Each item in the collection is a style sheet. A style sheet object is available for a style sheet only if it is included in a document with a style or link element, or with an @import statement in the style element.
Stock Implementation mshtml.dll Custom Implementation No Inherits from IDispatch Header and IDL files Mshtml.h, Mshtml.idl Minimum availability Internet Explorer 4.0 Minimum operating systems Windows 95, Windows NT 4.0, Windows CE 2.12