W3C home > Mailing lists > Public > www-validator@w3.org > August 2004

Re: [HAB] ID already defined error

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 12 Aug 2004 08:35:01 +0300 (EEST)
To: EE <ee@bjaili.com>
Cc: validator <www-validator@w3.org>
Message-ID: <Pine.GSO.4.58.0408120827140.19897@korppi.cs.tut.fi>

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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:44 UTC