The destination anchor of a link may be an element within an HTML document. The destination anchor must be given an anchor name and any URI addressing this anchor must include the name as its fragment identifier.
Destination anchors in HTML documents may be specified either by the A element (naming it with the name attribute), or by any other element (naming with the id attribute).
I admit to having a lot of old websites or pages that still have a lot of:
<p> <a name="bad-example"> </a> </p>
but I also still run into a lot of people that still using this sort of markup.
id="best-practice" is my friend.
Used to have to wrap the fragment identifiers in a <p> because pages wouldn't validate if one just slid the <a> in the page; though they worked.
Msg#: 3974355 posted 10:10 pm on Aug 24, 2009 (gmt 0)
I think the reason for the <a name> hangover is that it was not widely supported when fragment identifiers were introduced. Thus, the non-ideal situation of a new element just for the sake of a skiplink that was widely compatible.