[X]

JavaScript Style Sheets

browser wars 1996 dead

Netscape shipped a rival to CSS itself, written in JavaScript. This is the original CSS-in-JS, from 1996.

In 2026: Dead. JSSS ran only in Netscape 4, and Netscape 6 dropped it in 2000. Every browser since reads a style block typed text/javascript as an unknown script language and runs none of it, so the heading below stays its default size. The tag names had to be fully capitalised, document.tags.H1, or it threw.

Where it came from: Netscape JavaScript Style Sheets: submitted to the W3C in 1996, shipped in Navigator 4 in 1997. Dropped in Netscape 6, 2000. No other browser ever implemented it.
Wikipedia W3C JSSS submission

<!-- Netscape's answer to CSS: a stylesheet written in JavaScript -->
<style type="text/javascript">
  tags.H1.color = "purple";
  tags.H1.fontSize = "28pt";
  tags.P.fontStyle = "italic";
  document.classes.warn.all.color = "red";
</style>

<h1>Styled by JavaScript in 1996. Plain by 2026.</h1>
<p>This paragraph asked to be italic.</p>
<p class="warn">This one asked to be red.</p>
sandboxed demo · breaks nothing but itselfrestart

More in browser wars

view the whole library ›