Linking to a place on the same page with XHTML

Soldato
Joined
23 Oct 2003
Posts
8,899
Location
Hampshire, UK
Hi guys,

Bit stumped here. I need a link on a page which links to a different place down the page using XHTML 1.1

HTML used to be:
Code:
<a href="#one">Section one</a>

and later down the page:

<h2><a name="three">section one</a></h2>

Now, the W3C site says to use "id" instead of "name"
However, it doesnt work.
Can someone guide me

thanks in advance!
 
Using name is perfectly fine. Your code looks good from here, except you're trying to link to #three with #one? :confused:

The following should work:
Code:
<a href="#one">Section one</a>

and later down the page:

<h2><a name="one">section one</a></h2>
 
Why not just use

Code:
<ol>
    <li><a href="#one">Section one</a></li>
    <li><a href="#two">Section two</a></li>
</ol>

<h3 id="one">Section one</h3>

<p>blah blah blah</p>

<h3 id="two">Section two</h3>

<p>blah blah blah</p>
 
Back
Top Bottom