Jump to content

JavaScript Style Sheets

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 137.111.13.34 (talk) at 06:21, 20 February 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

JavaScript Style Sheets (JSS), an alternative to CSS proposed by Netscape in 1996. It is only supported by Netscape Navigator 4, having never been supported by Internet Explorer, and with support for it being dropped in Netscape 6+ / Mozilla / Firefox.

It is based on using Javascript code a stylesheet, the Javascript styling individual tags by modifying properties of the document.tags object. For example, the CSS:

h1 { font-size: 20pt; }

is equivalent to JSS:

document.tags.H1.fontSize = "20pt";

Note the case significance in tag names.

JSS is in some ways more powerful and in some ways less powerful than CSS. It lacks the various CSS selector features, supporting only a simple tag name selector. On the other hand, since it uses a full programming language to write stylesheets, stylesheets can include highly complex dynamic calculations and conditional processing. (In practice, in CSS, these are acheived by using Javascript to modify the CSS applicable to the document at runtime.)

Due to being written in Javascript, JSS stylesheets are less friendly than CSS stylesheets to the non-programmer.