[thelist] incorrect use of ID parameter?
Miles Tillinger
miles.tillinger at intecgroup.com.au
Wed Feb 12 00:18:28 CST 2003
Arghh, it's a pain, but I want to comply! /me gets another coffee...
> -----Original Message-----
> From: j.d. welch [mailto:so.there at showtunepink.com]
> Sent: Wednesday, February 12, 2003 4:25 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] incorrect use of ID parameter?
>
> On Wednesday, February 12, 2003, at 12:44 AM, Miles Tillinger wrote:
>
> > After running some of my HTML through validator.w3.org I have realized
> > that
> > I've been using the ID parameter incorrectly:
> >
> > e.g.
> >
> > Creating a CSS class for TD: TD#CLASSNAME { font-weight: bold; }
> >
> > And applying it to a TD: <TD ID="CLASSNAME">hello world</TD>
>
> > So when I run this through the validator it picks up a heap of
> > duplicate ID
> > parameter values. I haven't noticed any bad effects of this so far,
> > it just
> > means that running my pages through the validator is a bit of a
> > hassle! Am
> > I going to experience other problems doing things this way?
>
> indeed it will, and they are valid errors, even if browser X renders it
> 'correctly.' ids are _not classes_ and for elements that appear _once_
> in the page (http://www.w3.org/TR/REC-CSS2/selector.html#id-selectors).
> since presumably the td element is used multiple times, consider using
> a class instead, i.e td.classname {font-weight:bold}. the end effect
> will be the same (or better), you'll be conforming to the spec, and
> the validator will be happy.
>
> -jd
>
> ------------------------------------------------------------------
> J.D. Welch | so.there at showtunepink.com
> graphic designer | http://www.showtunepink.com
> web developer | http://kitschparade.ath.cx
> i'm available -> http://www.showtunepink.com/resume.html
> ------------------------------------------------------------------
>
> --
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
More information about the thelist
mailing list