Continuing with the "back to top" example, the code that is at the bottom of the page would look like this.
The addition of the # is what makes this link behave differently from the other links we have discussed in part one of this tutorial. It tells the browser to look for something on the webpage and that something is what comes after the #. In this case it is top. It does not have to be top. You can use whatever you like for the identifier. It is the physical placement of the code that makes this work. Now the browser has been told to look for the top identifier. So we need to put this at the location on the webpage that we want the browser to jump to. If you want the browser to go to the very top of the webpage, then you would put the identifier just below the <body> tag. If you want the browser to go to the top of a list, then you would put the identifier at the top of that list. OK, here is the code to place in that special location on the webpage.
If you do not put anything between the opening and closing tags (<a> </a>), as in the above example, this will work as an invisible link. Nothing will show on the computer screen. If you are using this as a link to the top of the webpage, you would probably not want to put anything between these opening and closing tags. However, if this is a jump to the top of a list, you would probably put the title of the list between the tags. Are you asking yourself if it is possible to go to a new webpage and jump to a special location on that page with one link. Yes. You would do this by placing the link with the href attribute and the #identifier on the referring page and the link with the name attribute and identifier will go on the new page at the special location. You can have many jump tags on one webpage. Just remember that it is the matching identifiers that tell the browser which special location to jump to. ← Back | | ||



Save to Del.icio.us




