When one wants to refer to some part of a webpage with the \"http://example.com/#foo
\" method, should one use
F
I have a web page consisting of a number of vertically stacked div containers, identical in format and differing only in serial number. I wanted to hide the name anchor at the top of each div, so the most economical solution turned out to be including the anchor as an id within the opening div tag, i.e,
<div id="[serial number]" class="topic_wrapper">
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.