You shouldn’t use <h1><a name="foo"/>Foo Title</h1>
in any flavor of HTML served as text/html
, because the XML empty element syntax isn’t supported in text/html
. However, <h1><a name="foo">Foo Title</a></h1>
is OK in HTML4. It is not valid in HTML5 as currently drafted.
<h1 id="foo">Foo Title</h1>
is OK in both HTML4 and HTML5. This won’t work in Netscape 4, but you’ll probably use a dozen other features that don’t work in Netscape 4.