Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a href="# not working

Status
Not open for further replies.

gcole

Programmer
Aug 2, 2000
390
0
0
US
I need simple code for an FAQ type page.
My code is not working, can anyone see what I am doing wrong?
Thanks in advance

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>frame test</title>
</head>
<body>
<a href="#section1">go to Section 1</a><br>
<a href="#section2">go to Section 2</a><br>
<a href="#section1">go to Section 3</a><br>
<br>
<br>
<h1 id="section1">Section 1: Beyond Introductions</h1>
<h2 id="section2">Section 2: Beyond Introductions</h2>
<h3 id="section3">Section 3: Beyond Introductions</h3>
</body>
</html>
 
Your code works for me. Of course if that's all the code you have then you really won't see any difference when you click the anchors because everything is in the screen at the same time. So there's no actual movement required.

Add more line breaks to push the headings down pout of view, and they'll be scrolled up when you click on the anchors.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
The name attribute on arbitary elements does NOT work as an document fragment anchor point. Added to that a name attribute is only valid on form elements and anchor elements as a document fragment identifier.

<a name="anchor_name">Named page fragment</a>


All current browsers handle an element ID being used as the document fragment identifier/anchor point.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks vacunita. It was working I just didn't have enough space for the cursor to actually move.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top