W3C home > Mailing lists > Public > www-style@w3.org > May 1998

Re: Class and ID

From: Steve Knoblock <knoblock@worldnet.att.net>
Date: Tue, 12 May 1998 00:07:19 -0400
Message-Id: <Version.32.19980511235453.01131a70@postoffice.worldnet.att.net>
To: www-style@w3.org
What about scripting? The distinction might be relevant to this kind of
"effects oriented" (dynamic) authoring. It seems that currently a script
requires a unique name for each element to manipulate it, therefore id is
increasingly used for programmatic reference while class is used to apply a
style to the same items.

Like

<div id=p1 class=menuitem>Item 1</div>

<div id=p2 class=menuitem>Item 2</div>

<div id=p3 class=menuitem>Item 3</div>

Now, you could use a unique class name, but it seems Netscape is not
friendly to this. Unless I'm seeing things...

You're right, it's good markup anyway. Separate styles/scripts applied to a
particular element from a style applied to all instances of the same class.
I guess it's possible to apply a script to all elements of the same class,
such as elementTOC.expandToc() (fictional code) to expand the whole table
of contents.

Steve

>instance of something as belonging to a class of things." From an
>effect-oriented CSS author's point of view, the distinction may be
>irrelevant, but from a markup point of view, it's a question of integrity.


   _/ Steve Knoblock                      mailto:editor@city-gallery.com
   _/ City Gallery                            http://www.city-gallery.com/
   _/ Member NSA               http://www.3d-web.com/nsa/nsa.htm
Received on Tuesday, 12 May 1998 00:07:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:55 GMT