Previous Message
Next Message

Re: [css-d] Putting together a tool set

Sent by Joe Howley on 26 January 2002 19:07

>So... if I understand right, this would be the equivalent of
><.div class="foobar"> relating to a linked style sheet with a
>selector div.foobar :{whatever}? Or am I being obtuse? Is the
>div id something applied to individual elements on the page or
>is it like a clas or pseudo class? (I have the feeling I should
>be getting this info from a primer somewhere, right?)

First, whether your stylesheet is internal to the page or is LINK'ed (or 
@import'ed, hurrah for that little trick) doesn't matter.

Bascially, as I understand it, for style purposes, an ID works like a class 
you can only use once per page.  You can have a .foo or a #foo in your 
stylesheet; however, in the first case, you can have any number of [DIV 
CLASS="foo"][/DIV]s in your page, while in the second you can only have one 
[DIV ID="foo"][/DIV].

Seems to me that unless you're going to be doing something to the layer with 
javascript, it's probably better to make it a class instead of an ID.  Then 
if you end up needing to have multiple layers with the same styles, no need 
to change the stylesheet.

The first time I coded the new design for my online school newspaper ( - watch out, we're in the middle of a transition 
from Joe's Redesign Code 1.0, featuring nested table madness, to Code 2.0, 
featuring full standards compliance), I made every layer an ID.  Then, six 
months later or so, I started revising and redoing a lot of the design code, 
and started kicking myself for all the IDs I created, because they 
restricted what I could do.

Anyway, I hope I got it right.  Someone correct me if I'm wrong.

joe howley

Get your FREE download of MSN Explorer at
Previous Message
Next Message

Possibly related: