Jump to content

links that refer to info further down the page


sugoi_kat

Recommended Posts

Hi,I don't know if this is the right place to post this, but ...I was just wondering how people implement those webpages, where there is a list of links at the top of the page, usually used for help/faq. When a user clicks on the link it directs them to the bottom where there is a paragraph on that topic and when the user clicks on the 'top' link the return to the top of the page.Kat

Link to comment
Share on other sites

that is done by linking to a certain anchor at a page, like this:<a href="thispage.htm#paragraph2">paragraph2</a>And somewhere on the document:<a name="paragraph2"></a>The first will scroll to the second :)

Link to comment
Share on other sites

the use anchors like this

<html>...<body><a name="top"></a><a href="#bottom">Go to bottom</a>....whole bunch of code....<a href="#top">Go to top</a><a name="bottom"></a></body></html>

Link to comment
Share on other sites

as a matter of fact, id's do work in this situation. i don't recall where i read it but i just have this vague recollection that the use of id's is preferable to names. if that is incorrect, i'll just keep it in mind but i've gone away from using names with no bad results.

Link to comment
Share on other sites

The name attribute is depreciated in Xhtml, or downgraded whatever, however, they planned reinserting the attribute into the dtd, while in forms, it was neccesary or whatever I don't know.Anyway, the name is not really forbidden :) But in the mean time, IDs and names should be used in conjunction, and secondly should not differ from eachother :)

Edited by Dan The Prof
Link to comment
Share on other sites

Yes you can use id's, it works ok in my PHP Version 4.4.0

The id Attribute Replaces The name AttributeHTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead.Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...