trinistorm Posted June 30, 2010 Share Posted June 30, 2010 I read on W3 (c8) that the name attribute for 'a' was deprecated Xhtml 1.0. If this is so then why is it still used? Link to comment Share on other sites More sharing options...
wirehopper Posted June 30, 2010 Share Posted June 30, 2010 I may have misunderstood your question, but I think it's still part of strict XHTML.http://w3schools.com/tags/tag_a.asp Link to comment Share on other sites More sharing options...
Synook Posted June 30, 2010 Share Posted June 30, 2010 It's still present, but it is deprecated in favour of the id attribute. Some old browsers don't recognise IDs when using hash-tag navigation though, I believe. Link to comment Share on other sites More sharing options...
wirehopper Posted June 30, 2010 Share Posted June 30, 2010 It's good for links within a page. Link to comment Share on other sites More sharing options...
trinistorm Posted June 30, 2010 Author Share Posted June 30, 2010 So what gives? So its still present for backwards compatibility? If so then the REC is a bit misleading. Link to comment Share on other sites More sharing options...
trinistorm Posted June 30, 2010 Author Share Posted June 30, 2010 I may have misunderstood your question, but I think it's still part of strict XHTML.http://w3schools.com/tags/tag_a.asp I was referring to the documentation at http://www.w3.org/TR/2002/REC-xhtml1-20020801/#dtds. The part aboutFinally, note that XHTML 1.0 has deprecated the name attribute of the a, applet, form, frame, iframe, img, and map elements, and it will be removed from XHTML in subsequent versions. Link to comment Share on other sites More sharing options...
jeffman Posted June 30, 2010 Share Posted June 30, 2010 You're correct. name is deprecated in XHTML 1.0 and dropped from XHTML 1.1, which is the current recommendation. If you need bookmark ability (the # tag) your <a> element should have an id attribute. Modern browsers use the id in a bookmark tag the way older browsers used the name. Any browser that recognizes the 1.1 DTD will behave correctly. I'm not sure, but I believe this is true of IE6, which is the oldest browser I ever worry about. IE6 behaved correctly (in this regard) before Mozilla did. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.