Click here for great long-distance rates!

PC Magazine

  PC Tech

JavaScript- Powered Stylesheets

Introduction

Setting the Stage

Building Blocks

Getting Dynamic

A Site for All Seasons

Figure 1: Setting style rules for IE and Navigator.

Figure 2: Customizing a Web site based on window size.

Figure 3: Creating a Web site for all seasons.



X10.com - The SuperSite for Home Automation!

NextCard Internet Visa - Apply Now

 
  Categories
World Wide Web

JavaScript-Powered Stylesheets
Figure 1: Setting style rules for IE and Navigator.

Continued from A Site for All Seasons

<html>
<head>
<style id="ssA" type="text/css"></style>
<script language="JavaScript">
<!--
if (document.all) {
document.styleSheets["ssA"].addRule ("h1", "color:blue");
document.styleSheets["ssA"].addRule ("h1", "font-size:50pt");
} else if (document.layers) {
document.tags.h1.color="blue";
document.tags.h1.fontSize="50pt";
}
// -->
</script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>

Next: Figure 2: Customizing a Web site based on window size.

Published as Internet Builder in the 5/4/99 issue of PC Magazine.

Related Links
Server-Side JavaScript -- PC Tech
DHTML That Works in Both IE and Navigator -- PC Tech
JavaScript -- DevHead
ScriptHead Archive -- DevHead
 
JavaScript Programming Courses -- ZDU

 
 SPONSORED LINKS
QUANTUM  Storage solutions to count on 24 hours/day, CLICK HERE
Sprint  FrameRelay: See why users rate Sprint #1 for frame relay
Beyond.com  Click here for free software!
Software  X10.com -- The SuperSite for Home Automation
Books  Buy a gift for MOM, a book from barnesandnoble.com
 ZDNET FEATURED LINKS
Freebies!  The latest FREE files - yours to download and keep!
Shop Smart  Compare prices on over 7,000 computer products & save
Contest  Win a Diamond MP3 Rio from ZDNet Auctions!
 MAGAZINE OFFERS
Free Issue  Get a risk-free issue of RED HERRING magazine today!

TOP
Copyright (c) 1999 Ziff-Davis Inc.