HTML and CSS Reference
In this Try It you learn how to link to another part of the current web page.
You will need a previously created web page, a text editor, and a web browser.
Open your text editor.
Open the previously saved thoreau.html .
Place your cursor within the opening <h1> tag and add a space followed by this code:
After the closing </p> tag in each section of quotes, press Enter (Return) and add this code:
Place your cursor before the text On Living in the list of categories and add the following code:
After the text On Living in the list of categories, add the following code:
Repeat steps 5 and 6 for the two remaining categories, On Topics and On Government , with
these href values, #books and #government , respectively.
Change the <h2> tag On Living to the following code:
Repeat step 8 for the two remaining <h2> tags, On Books and On Government , with these ID
attributes, books and living , respectively.
Save your document.
In your browser, open thoreau.html to view the links, as shown in Figure 8-3.
Click any category link ( On Living , On Books , On Government ) to test your internal links
and then click Top.