p> a href="#anchor1"/>Anchor 1 /p> p> a href="#anchor2"/>Anchor 2 /p> p> a href="#anchor3"/>Anchor 3 /p>
div id="body"> p>Text in first paragraph. The anchors apply to the h2 headings in subsequent paragraphs /p>
The hyperlink that is created by Anchor 3 also applies to the first paragraph and I can't work out why. It validates fine. I have compared it with the much less tidy HTML from a basically identical NOF page and apart from the gunk that NOF adds, there's no difference. Yet the old NOF page doesn't suffer this.
The text above is a bit broken up, due to the forum losing the left-chevrons; however it does validate as XHTML 1.0 Strict. Basically XHTML is not all that fancy, as it's just strict HTML 4.01 made a lot stricter.
Your code as written above "<p><a href="#anchor1" />Anchor 1</p>" fails in my validator with the following message:
'The "a" tag should be closed by using an end tag (like </a>). It should not be closed by adding a slash to the end of the tag (<a ... /> is not recommended). Note that this may be technically valid according to XML parsers and validators but it may not be technically valid according to the XHTML specification because all elements that are not declared as EMPTY must have an end tag. In any case, it is highly recommended that you use an end tag for backward compatibility. Even newer browser such as Internet Explorer 6.0 may have problems displaying your page correctly if you do not use a separate end tag.'
"<p><a href="#anchor1">Anchor 1</a></p>" however, validates okay. I use the Lite (free) version of the offline validator downloaded from click here.