Specifies a style sheet for the page.
Members Table
The following table lists the members exposed by the
style
object.
Attributes/Properties
Attribute | Property | Description |
---|
DISABLED | disabled |
Sets or retrieves a value that indicates whether the user can interact with the object. |
ID | id |
Retrieves the string identifying the object. |
| innerHTML |
Retrieves the HTML between the start and end tags of the object. |
Collections
Collection | Description |
---|
behaviorUrns |
Returns a collection of Uniform Resource Name (URN) strings identifying the behaviors attached to the element. |
Events
Event | Description |
---|
onerror |
Fires when an error occurs during object loading. |
onreadystatechange |
Fires when the state of the object has changed. |
MethodsStyles
Style attribute | Style property | Description |
---|
MEDIA | media |
Sets or retrieves the media type. |
TYPE | type |
Retrieves the Cascading Style Sheets (CSS) language in which the style sheet is written. |
Remarks
The STYLE element should appear in the HEAD section of an HTML document. Microsoft Internet Explorer 4.0 and later permit multiple style blocks.
This element is not rendered.
This element requires a closing tag.
Example
This example encloses style declarations in the STYLE element and changes one of those settings using the style object.
<HEAD>
<STYLE>
BODY { background-color: white; color: black; }
H1 { font: 8pt Arial bold; }
P { font: 10pt Arial; text-indent: 0.5in; }
A { text-decoration: none; color: blue; }
</STYLE>
<SCRIPT>
oParagraph.style.fontSize = 14;
</SCRIPT>
</HEAD>
<BODY>
<P>Sample Paragraph Text</P>
</BODY>
Standards Information
This object is defined in
HTML 3.2 .