
Anchors, a.k.a. Targets, a.k.a. Bookmarks, are links within a web page. A
very common use of anchors is to create a table of contents that will link
to different sections of a long web page. There are two parts in making
a page anchor.
 |
Like all
other link tags, you need <ahref= "___">text or image</a>. In the space
between the two quotations, enter a '#' and then any word, which would
be the codename (note: the codename is case sensitive). So, it'll look
like this:
<a
href="#codename">text or image</a>
Unlike regular
href tags, placing a '#' in the quotes instructs the browser to look within
the same page for the named link. |
 |
Since anchors
are just a type of link, it needs something that all links need: something
to link to. If you were linking to another page, obviously that page has
to be labeled correctly or else it's a broken link, where you don't end
up anywhere. Linking within the same page works like that too. You have
to label the section that you want to go to.
To do this,
type: <a name= "#codename"> right
above the section that you are linking to. Remember again that the codename
is case sensitive. |
An
example (The 'menu' on my links page).
To make an anchor that will to go back to the top of the page, make top
the
codename. This link is automactically interpreted by a browser to mean
go
back to the top of the page, without you having to place a <a
name> tag on the top of the page. Examples:
| <ahref="#top">top</a>
<a href=
"#top"><imgsrc="t-1.gif"></a> |
creates: top
creates: . |
Press
either the underlined text or the image to return to the top of the page.
If you wish for either some text or an image to link to a specific target
on another page, simply put into the quotation marks "blank.htm(l)" and add
to it "#anchor's name". For example if you wish to jump from htm(l) document
1 to section C
on htm(l) document 2,
you create this link in document 1:
<a href="2.htm(l)#C">linking text orimage</a>.
|