HTML and CSS Reference
In-Depth Information
12.4. JavaScript Stylesheets (Antiquated)
Much of a browser's work is manipulating the display, and much of its dis-
play code already has been exposed for JavaScripting. So it seemed only
natural, perhaps even relatively easy, for the developers at Netscape to
implement JavaScript Stylesheets (JSS). Based on the World Wide Web
Consortium (W3C)-recommended CSS model, outlined in Chapter 8 , this
alternative document style technology lets you prescribe display proper-
ties for all the various HTML elements, either inline as tag attributes, at
the document level, or for an entire document collection.
JSS is antiquated. Even the inventor eschews support for JSS entirely
in favor of the standard CSS2. We are strong proponents of reasonable
standards, and now that the CSS2 model is fully supported in HTML 4
and XHTML, we can't recommend that you use anything but CSS-stand-
ard stylesheets.
We thoroughly discuss the concepts and ideas behind stylesheetsspecific-
ally, Cascading Style Sheetsin Chapter 8 , so we won't repeat ourselves
here. Rather, we address only how to create and manipulate styles with
JavaScript here purely for historical reasons. Before forging ahead in this
section, we recommend that you first absorb the information in Chapter
8 .
12.4.1. JavaScript Stylesheet Syntax
Netscape versions 4 and earlier implemented JSS by extending several
existing HTML tags and defining a few objects that store your document's
styles. Netscape no longer supports JSS, nor does any other browser.
12.4.1.1. External, document-level, and inline JSS
As with CSS, you can reference and load external JSS files with the <link>
tag. For example:
 
Search WWH ::




Custom Search