Previous Message
Next Message

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

Sent by Lachlan Cannon on 26 January 2002 21:09


>Basically, as I understand it, for style purposes, an ID works like a 
> >class
>you can only use once per page.
...

>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.

It depends on what you're using the ID for. For example, if you're using a 
layour with one div for a menu, and one div for the content area (ala the 
design I'm working on (older version at 
http://members.evolt.org/luminosity/test/compose.html )), then it makes 
perfect sense to use IDs. This way I enforce that I never accidently use 
that style again - since IDs are unique, and if I did reuse this declaration 
then I'd have one div sitting on top of another one, hiding the one 
underneath... which would be rather stupid.

IDs for things that should only ever appear once, which will most likely be 
layout things.

classes for things you'll repeat, which will likely apply at some stage to 
all inline styles.

Lach

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com
Previous Message
Next Message

Possibly related: