Anchors


Anchors are ways of linking to different parts of a single page. In a way, it is similar to targeting a link to a frame, because you first have to name each section, then link to it.

1. Name each section you want to link to. Do this with the following code:

<a name=NAMEHERE>TEXT GOES HERE

2. Link to the sections with this code. Remember to leave the # on:

<a href=#NAMEHERE>TEXT GOES HERE


An example of the html for a site with anchors:

<a href=#birth>When I was little</a> <a href=#now>What I'm like now</a> <a href=#pets>My family's pets</a> <a name=birth>I was born on September 25, 1986, early in the morning. I was a fat baby--I was born 3 days late, and I was really tall. Even then, my doctor predicted that I would be tall when I grew up (which hasn't happened so far.) <a name=now>Now, I'm 13 years old. I like to play sports, like basketball, soccer, and tennis. I'm in 8th grade. <a name=pets>My family has lots of animals. A family friend who lives in our attic brought along some of her pets, too, which adds up to 4 cats and 6 guinea pigs.