Lesson 9: Internal Anchors


Return to Lesson 8

Continue on with Lesson 10


An anchor is like placing a bookmark within a document. It allows you to access another part of the document quickly and easily without scrolling down through the whole thing. You can also link from one document to the specific anchor in another document. <A>...</A> marks the anchor HREF= tells where to jump to on the web NAME= tells where to jump to within the document For example: If you had a page of recipes, you could have a list of the recipes at the top of the page. Then, click on the title of the recipe and it would jump to that recipe without having to scroll down through all the other recipes to get to it. <A HREF="nameof webpage.html#keyword">Name of Recipe</a> <A> means we started an anchor. HREF means we should jump to the file listed in the quotations. #Keyword is the unique name of the spot that you want to jump to. Name of Recipe is the word or words that you would click on to make the jump. </A> tells the computer that this is the end of the anchor. Now at the point in the list of recipes where the recipe for this anchor is, you must also place an anchor. This anchor looks like: <A NAME="Keyword">Name of Recipe</A> NAME basically means that this is the unique keyword for this spot in the document. Assignment 9 Create the following HTML document and check it in your browser. Save this document as rhymes.htm Note: you may have to make your browser window narrower horizontally to make this document actually jump to the right part due to the document being so short, but you can get the idea. <HTML> <HEAD><TITLE>Rhymes</TITLE></HEAD> <BODY> <H1 ALIGN=CENTER>Rhymes</H1><BR> <A HREF="rhymes.htm#Mary">Mary Had A Little Lamb</A><BR> <A HREF="rhymes.htm#Hickory">Hickory Dickory Dock</A> <P><A NAME="Mary">Mary had a little lamb </A><BR> It's fleece was white as snow<BR> But everywhere that Mary went<BR> The lamb was sure to go.</P> <HR> <P><A NAME="Hickory">Hickory Dickory Dock</A><BR> The mouse ran up the clock<BR> The clock struck one<BR> The mouse ran down<BR> Hickory Dickory Dock</P> </BODY> </HTML> end of lesson