> At 02:11 PM 1/9/2006, CJ Larson wrote: >> > <li><a href="about" id="active" >> > id="menu_about"><span>About</span></a></li> >> > >> > Note we have just changed the class="active" to id="active". Your >> > global CSS file would then include something like this: >> > >> > ul li a#active {background-color: foo;} >> >>One note about this: now he has two IDs instead of one ID and one >>class. > > Which is, of course, perfectly valid. There is nothing wrong with > attaching two IDs to a single element, so long as the attribute > values are unique within the document. > > -Adam Kuehn >
Not correct, at least in XHTML. From XHTML 1.0: "In XML, fragment identifiers are of type ID, and there can only be a single attribute of type ID per element." [1] While HTML 4.01 does not explicitly preclude the use of multiple ID attributes on an element[2], I believe it should not be considered good practice, as it comes into conflict with other W3C standards relevant to HTML documents. For example, DOM 1.0 defines the "id" attribute of "HTMLElement" to be of type DOMString [3]; this cannot support multiple IDs per element. I would suggest that the lack of specific exclusion of multiple IDs per element in HTML 4.01 is an oversight in the specs. [1]<http://www.w3.org/TR/xhtml1/#h-4.10> [2]<http://www.w3.org/TR/REC-html40/struct/global.html#adef-id> [3]<http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-58190037> Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/