Read my article HTML5 apps as a learning tool
<Table of Contents>
Get Details on GreenGeeks Secure Hosting Learn HTML5 Today!
>>
- Bob's HTML Course - Take HTML5 Lessons - Twitter - Dave's Blog - Learn on your iPad
Web Hosting HTML Tutorial CSS Tutorial Web Design Tutorial Hosting under

HTML Code MiniChapter 9: Navigation Within A Document

HTML Tutorial Chapters:  

iPage Hosting $95 Plan on sale today for $1.89/mo
Click Here for More Details!

I have a new iPad Course: Web Design Basics.   Download your copy now from AppStore.
Web Design Basics covers both HTML and CSS together in one interactive guide.   Get it Now!

Navigation Within a HTML Document...

< back to the previous chapter

Wouldn't it be nice to be able to click a link and move to another area within the same page? Well you can. You will use the normal anchor tag (<A HREF>) except instead of placing another page in the quotes, we will use a named portion of the document, which begins with a #. To name the part of the document, go to the area you want to name, and place <a name="name_of_area">text</a>, then to call a link to that place from somewhere else in the document, use <a href="#name_of_area">text</a> Example:

<a href="#section2">Go To Section 2</a><br>
blah<br>
blah<br>
blah<br>
blah<br>
blah<br>
blah<br>
<a name="section2">Welcome To Section 2!</a>


Go To Section 2
blah
blah
blah
blah
blah
blah
Welcome To Section 2!

Once you have the section named, you can even call it from other documents... for example, if you named a section in index.html called section2, you could call it from bookmarks.html using <a href="index.html#section2">.

Using internal page links seems silly on a short page like this, but it definitely pays off on long pages.


HTML Code - Try it Yourself!

In the Box below, type the following HTML code, then click "Check it Out!" The HTML document you made will be displayed in your browser. You may wish to change the words within the tags just to try it out.

Try typing this:

(Okay, I encourage you to COPY and PASTE this chapter's code into the box instead of typing it!)

<html>
<head><title>Navigation is Cool</title>
</head>
<body>

<a name="section1">This Is Section One</a><hr>
<a href="#section2">Click Here to Go to Section 2!</a>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
<a name="section2">This Is Section Two</a><hr>
<a href="#section3">Click Here to Go to Section 3!</a>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
<a name="section3">This Is Section Three</a><hr>
<a href="#section1">Click Here to Go to Section 1!</a>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
This page Copyright &copy; Little Joe's Pages &amp; davesite.com.

<a href="http://www.davesite.com/webstation/html/chap09.shtml">Back to The Tutorial!</a>
</body>
</html>



Get the Latest Phones at TracFone Wireless! View Today's Phone Deals!
Hosting CompanySpecial FeaturesHost DetailsDisk Space/
Bandwidth
Domain PricePrice (Click for More)
iPage Expert
Web Hosting
"Best Control Panel Ever"/
Enhanced Security/100% Green
Unlimited/UnlimitedFree (ever year) $8.49/mo $1.89/mo
1&1 Hosting Enhanced Security (SSH)/
Scripting, and IMAP Secure Email
250GB/Unlimited 3 Free (every year) $9.99/mo

HTML An Interactive Tutorial
Continue Next Chapter
Make your success certain by using our incredible http://www.pass4sure.com/SY0-301.html study packages and http://www.actualtests.com/exam-350-050.htm. We are providing the best http://www.test-king.com/exams/650-377.htm and http://www.certkiller.com/answers/ccna-practice-test.htm training solutions for preparations. You can also get http://www.examsheets.com/exam/70-685.htm from our website.
Copyright © Dave Kristula. All rights reserved.
URL: http://www.davesite.com/webstation/html/chap09.shtml