HTML and CSS Reference
In-Depth Information
Figure 2-19
Adding the id attribute to h2 headings
h2 heading mar ked
with an id value of "A"
h2 heading mar ked
with an id value of "B"
3. Continue going down the file, adding id attributes to the opening <h2> heading
tags for C, D, E, and F corresponding to the letters of those headings.
For longer documents like the Glossary page, it's also helpful for users to be able to
jump directly from the bottom to the top of the page, rather than having to scroll back
up. With that in mind, you'll also add an id attribute marking the element at the top of
the page.
To mark the top of the page:
1. Scroll up the glossary.htm file in your text editor and locate the header element
directly below the opening <body> tag.
2. Insert the following attribute within the opening <header> tag, as shown in
Figure 2-20:
Figure 2-20
Adding the id attribute to the page header
header ma rked w ith
an id value of "top"
3. Save your changes to the file.
Search WWH ::

Custom Search