Web Page Basics -- Usage of Named Anchors

web front end nine thousand eight hundred and forty-nine 13 years ago (2011-01-13)

Naming anchor: the user sets tags in the document. These tags are usually placed in specific documents theme At or top. Then create links to these named anchors, which can quickly take the viewer to the specified location.

What exactly is html anchor? In simple terms, for example, for a long article, if you want to see it accurately by segment, you can use anchor points. The purpose of adding id is to make it compatibility Better
The href value must be consistent with name i d, and must be preceded by "#". The above code is in the IE6 /7 and ff are compatible, but not in ie8.
Because the<a></a>value of our anchor point is empty, we can add a space to not affect the beauty.

Suppose there is an anchor link:<a name="1" id="1">anchor 1</a>

Point to the anchor with another link:<a href="# 1">Jump to anchor 1 of the current page</a>

Another question What if you want to link to an anchor content on another page (such as twopage. html)?

The codes are as follows:
Links to the current page
<a href="twopage. html # 1">Jump to anchor 1 of the twopage</a>

Anchor point of another page:
<a name="1" id="1">Anchor 1</a>