Using #top or #bottom
The following examples use #top and #bottom with the <a> and href
attribute to link to that section of the page. This method is similar to using
"id", but you don't have to pick a specific element. Click "Top" or "Bottom" in
the Results section to see what happens.
Using the id selector
In CSS, "id" is a selector that is used to designate an area that a link should
point to, similar to anchor in HTML. The nice thing about using id is you can
create a link to any element on the page, rather than only the top or bottom.
In the following sections, we show you how to apply id to an HTML tag, and
then how to link to it. The following two examples link to the opening
paragraph at the top of this page.
Complete HTML page code example
The following code shows how both the #top and #bottom anchors and the
id selector can all be used on the same page.