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

Re: [HAB] ID already defined error

From: EE <ee@bjaili.com>
Date: Fri, 13 Aug 2004 10:12:01 +0300
Cc: validator <www-validator@w3.org>
Message-id: <1092381121.2628.4.camel@localhost.localdomain>

Dears,

Sorry for my poor question.

This is exactly my problem which is I am using id instead of class. I
tried the little trick (leaving a space before the colon) shown below
but no help.

Thank you 

On Thu, 2004-08-12 at 08:35, Jukka K. Korpela wrote: 
> 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.
Received on Friday, 13 August 2004 07:17:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:08 UTC