Yep, you can only use an ID value once on a page (ie. lots of IDs but never two with the same value)
Think of IDs as specific containers or objects that can be referenced by many facets of web tech, not just CSS, but HTML/XHTML (eg. in-page anchor tags now use the ID attribute as the anchor point; the <a name> technique is now deprecated), Jscript and Dynamic HTML (how do all those divs fly all over the place, by use of uniques IDs). Thus you can't have ID values duplicated within a page. Classes are merely specifications of objects (height, width, color etc etc) and can be applied to virtually every HTML/XHTML tag set, bearing in mind of course that you can place default styles on the tags themselves from within a stylesheet. You can apply a class as often as you want. Classes are for reuse. IDs relate directly to blocks of web content, hence they can only appear once on a page. Cheers JamesB -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Kear Sent: 13 March 2004 23:21 To: [EMAIL PROTECTED] Subject: RE: [WSG] text and graphic on one line PROBLEM SOLVED! Or even the other way around perhaps? One use on a page : ID Multiple use : class As I understand it, you can only have one selector labelled with any particular ID on a page, but you can have as many selectors with the same class as you like. You can have dozens of selectors labelled with IDs but not two with the same ID. Yes? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brewnetty (AuntySpam) Sent: Sunday, 14 March 2004 9:50 AM To: [EMAIL PROTECTED] Subject: Re: [WSG] text and graphic on one line PROBLEM SOLVED! This is the way I understand it: When you want to use any style more than once, you use ID When you want it to apply to one element only, you use class. Is that too simplified? AuntySpam, SLP Coordinator, pspug.org http://www.pspug.org/edu/edu.shtml http://www.pspug.org/edu/slp/assign.shtml http://www.pspug.org/edu/slp/slpparticipants.htm ***************************************************** The discussion list for http://webstandardsgroup.org/ ***************************************************** ***************************************************** The discussion list for http://webstandardsgroup.org/ ***************************************************** ***************************************************** The discussion list for http://webstandardsgroup.org/ *****************************************************
