Chapter 3

Links and Navigation

What You Will Learn in This Chapter

  • How to link between pages of your site
  • How to link to other sites
  • How to structure the folders on your website
  • How to link to specific parts of a page in your site Code Downloads for this Chapter

You can find the code downloads for this chapter at on the Download Code tab. The code is in the Chapter 3 download and individually named according to the names throughout the chapter.

What distinguishes the web from other mediums is the way in which a web page can contain links (or hyperlinks) that you can click to be taken from one page to another page. The link can be a word, phrase, or image.

When you link to another page in your own website, the link is an internal link. When you link to a different site, it is an external linkand uses what’s known as an absolute URL—a URL that includes the full web address (like In this chapter you learn how to create both types of links. You also see how you can link to a specific point within a page.

Although you can learn the basics of linking from one web page to another fairly quickly, you also must learn some other concepts, such as how to structure your site well by storing different files in separate folders or directories. When you understand directory structure, you can link between pages of your own site using shorter links called relative URLs.

Basic Links

You can specify a link ...

Get Beginning HTML and CSS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.