Re: [HAB] ID already defined error

On Wed, 11 Aug 2004, EE wrote:

> An "id" is a unique identifier. Each time this attribute is used in a
> document it must have a different value. If you are using this attribute
> as a hock for style sheets it may be more appropriate to use classes
> (which group elements) than id (which are used to identify exactly one
> element).

Which part of this explanation (which you quoted, and I re-quote here)
did you fail to understand? Most probably it applies to your situation
too, i.e. you should replace id="menulink" attributes by class="menulink"
attributes and correspondingly replace #menulink by .menulink in your CSS
code.

It's also possible that you could use a simpler approach: use just one
id="menulink" attribute, in the <table> element for example in your case
if I guess right, and use correspondingly a contextual selector, in CSS -
e.g., instead of
  #menulink:link { ... }
you would then use
  #menulink :link { ... }
(note the space). But this belongs to the realm of CSS; I mention this
just to emphasize that the validator's message is just a suggestion on how
the error might be removed.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Thursday, 12 August 2004 05:35:04 UTC