CoderTools Web site

HTML Bookmark Links


You can create links to sections of an html page. This is useful if you have a long page that you want to allow the users to quickly navigate to different sections.

When a user clicks on a bookmark link in the current page the page will scroll so that the bookmark is at the very top of the page.


For example:

First you need to place a bookmark (named anchor) in your page where you want the user to be able to jump to:
    <a name="bookmark1" >Bookmark1</a>
Then you need to add a link that the user can click on to jump to the bookmark:
    <a href="#bookmark1">goto bookmark1</a>
note: you can link to a bookmark on a different page but pre-pending the url of the page to the bookmark name in the href attribute:
    <a href="">
        goto bookmark1

Attributes for <a>

Name Values Description
href url
Specifies the url of the destination
title text
the title of the target document
target name
the window or frame the linked to document should be displayed.
_blank opens a new browser window
accesskey a single character e.g. a Specifies an shorcut key used to access the link from the keyboard.
tabindex number Specifies the tab index. When a user presses the tab key the focus is moved to each element in the tabindex order. This is useful when there are many links as the user can tab through each link
name text
Used to create a named anchor. Specifies the name of a part of the document (a fragment). You can link to fragments using the href attribute by pre-pending # to the name
rel next
Creates a relationship between the current page and the target page.
rev next
The relationship from the target page back to the source page.

12/16/2017 8:41:57 AM
Terms Of Use | Privacy Statement | Copyright 2006-2015 © Independence Software LLP