Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

100 LESSON 6: Working with Links


After you have the URL of the page, you can construct a link tag in your menu file and
paste the appropriate URL into the link, like th is:

Input ▼
<p>"<em><a href="http://en.wikipedia.org/wiki/The_Twelve_Caesars">
The Twelve Caesars</a></em>" article in Wikipedia has more information on these
Emperors.</p>

In that code I also italicized the title of the page using the <em> tag. You’ll learn more
about that tag and other text formatting tags in Lesson 7, “Formatting Text with HTML
and CSS.”
Of course, if you already know the URL of the page to which you want to link, you can
just type it into the href part of the link. Keep in mind, however, that if you make a mis-
take, your browser won’t be able to find the file on the other end. Many URLs are too
complex for humans to be able to remember them; I prefer to copy and paste whenever I
can to cut down on the chances of typing URLs incorrectly.
Figure 6.7 shows how the menu.html file, with the new link in it, looks when it is dis-
played.

Output ▼


FIGURE 6.7
The Twelve
Caesars link.


Free download pdf