HTML 4 home

 


A really simple example of style sheets

World's fastest and shortest introduction to style sheets

A bit more explanation about style sheets

Path animations with HTML 4




Classes home

HTML Info home

 

HTML 4

Jeff Williamson
Northern Virginia Community College
www.nvcc.edu/home/nvwillj/html4/


A bit more about stylesheets

O.k., so you learned how to build a stylesheet and insert it into a document. Now what - why would you want to do this, and how can you make your stylesheets richer?

Stylesheet technology has been around for a long time - most word processors have the capability to define styles globally across many documents instead of word-by-word.

The advantage is that you can change formatting on an unlimited number of documents by just changing one stylesheet.

The disadvantage is that you can change formatting on an unlimited number of documents by just changing one stylesheet.

It's hard to create a global layout that works for all documents. It's even harder to do this when your layout tools are pretty crude.

I've used stylesheets across my site for a few months now and I'm not really satisfied with them.

Problems:

Stylesheets display pretty differently in different browsers. IE 4 pretty much displays everything; NN4 displays some things, while NN3 follows nothing and IE3 is the eccentric pioneer of stylesheets.

HTML layout is already pretty rubbery; stylesheets are just one more thing that adds hard-to-predict variability to your site. I'm constantly finding bad-looking pages in my site because of some hardware/software variation that I hadn't tested for.

I guess this is a Dreamweaver problem, but I keep finding copies of my global stylesheet in individual directories - DW seems to be importing, rather than linking to the stylesheet. That obviously makes it unhelpful.

One good thing

I'm sticking with stylesheets for now because I like the way they let you see how typographic changes work across a site without hard-coding everything. My rule for the moment is then "design with stylesheets, but hard-code everything for production."

Note

Stylesheets are referred to as CSS or Cascading Style Sheets. Why the flowery name? There are actually three levels of stylesheets you can use:

external linked stylesheets
stylesheets internal to your document
styes written directly into HTML tags

Only the first one has seemed interesting to me; it's the method that allows multiple document changes from one file change. The general rule, and how they style sheets cascade, is that authority increases as the styles become more local. So a linked stylsheet specification that <H1> tags be red can be overridden in a specific document or part of a document with an internal stylesheet or tag-level style.

Links

Getting Started with CSS at C|Net
WDVL on Style Sheets