Previous Example-|-Next Example-|-Return to Chapter Listing

Example 14.9:
A Simple Stylesheet Example

[This example works with Netscape Navigator 4. It won't work with Netscape Navigator 2 or 3, or Internet Explorer 3.]

The above heading is an HTML Heading 1. It's displayed in the default color. But the heading below is red, because we've set the document's style to show all Heading 1s as red from this point on. (If you're using Netscape Navigator 3, you'll see tags.H1.color = "red" above the heading, as that browser displays the text between the style tags.)

Another Heading 1


Here's how we set the style to red for Heading 1: <STYLE TYPE="text/javascript"> tags.H1.color = "red" </STYLE>
Previous Example-|-Next Example-|-Return to Chapter Listing