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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link on same page 1

Status
Not open for further replies.

MarkJ2

Technical User
Sep 25, 2001
17
US
What I would like to do is write one FAQ html page with the FAQ's at the top and when the user clicks on the question, the page 'jumps' to the answer text that is below on the same page.

Sort of like....(just an example)

1. What is in the catalog? (the user can click on these)
2. How do I find a book?
------------------------------------------------------

when they click on the above line of text, the page 'jumps' to the appropriate text.

1. The catalog contains lots of good stuff.

2. Try a search by title.


I have looked in a HTML book I have but can not find an example. What elements/tags should be used and how should the HTML be written?

Thanks...have a Good Thanksgiving (if your in the U.S.A.)

 
The correct tags to use are Named Anchors.

Basically you need to place a named anchor at the point in the page to which you wish to jump. The format of a named anchor is:

<a name=&quot;anchorname&quot;></a>

and it is referenced as a link by using &quot;#anchorname&quot; - you can also link to a named anchor in another document, by specifying the filename as well as the anchore reference, such as &quot;secondpage.html#sectiontwo&quot;.

Using bits from your example:

The menu would say:

<a href=&quot;#catalogcontent&quot;>1. What is in the catalog?</a>
<a href=&quot;#howtofind&quot;>2. How do I find a book?</a>

Then in the rest of the document...

<a name=&quot;catalogcontent&quot;></a>1. The catalog contains lots of good stuff.
text text text text text text text text text text text text text text text text text text text text text

<a name=&quot;howtofind&quot;></a>2. Try a search by title.
text text text text text text text text text text text text text text text text text text

Regards,

Jon Wilson
Threespot Limited
 
Back to top of page would just be a #.

<a href=&quot;#&quot;>Back to top</a>
 
Romannl,

Would I need to put a marker at the top of the document, or would putting the code <A HREF=&quot;#&quot;>Back to top</A>
automatically take the user back to the start of the page?

Thanks
 
Hi mate,

Just a suggestion but if you want to save yourself the hassle of updating a faq page etc, you can get a free script that makes the job as easy as can be.

You simply enter the admin area, choose the subjects you want then you are presented with 2 text fields, type the question in one and the answer in the other.

I use this and it`s great!!


Hope this helps Wullie

 
No marker (anker) is needed. Just the link to # should get you back to the top of your page!

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top