News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Anchor Tag & Name Attribute in HTML

Started by sajiv, Aug 18, 2008, 07:11 PM

Previous topic - Next topic

sajiv


The name attribute is used to create a named anchor. We can create links that can jump directly into a specific section on a page, using named anchors instead of letting the user scroll around to find what he/she is looking for.

Below is the syntax of a named anchor:
<a name="label">Text to be displayed</a>

To create a named anchor the name attribute is used. The name of the anchor can be any text you care to use.
The line below defines a named anchor:
<a name="main">Main Section</a>

You should notice that a named anchor is not displayed in a special way.
To link directly to the a section, add a # sign and the name of the anchor to the end of a URL, like this:
<a href ="#main">Jump to the Main Section</a>

A hyperlink to the Main Section from within the file "html_links.asp" will look like this:
<a href="#main">Jump to the Main Section </a>

:acumen

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S post or ALT+P preview