Re: Class and ID

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 UTC