How to use an anchor in the HTML page

This article will explain you in detail about how to use html web pages anchor, Xiao Bian feel very practical, so the share to be a reference, I hope you can gain something after reading this article.

anchor is a web production hyperlinks, also known as named anchor. Named anchor like a rapid locator as a hyperlink within a page, use quite common.
English name: anchor
can be set using a named anchor tag in the document, these markers are usually placed at a specific topic or at the top of the document. You can then create these named anchor links, which can be quickly takes the visitor to the specified location.
to create a link to a named anchor of the two-step process. First, create a named anchor, and then to create the named anchor links.
Example Code
as defined below in place of the anchor in an HTML page:

   Here is the TOP portion   Here is CONTENT portion   here is the FOOT portion   

(You can use the id attribute instead of the name attribute, named anchor equally effective. [1])
there are two methods for accessing the anchor described above
a tag is the use of hyperlinks production anchor link is mainly used in the anchor access page

   click on my link to TOP   click on my link to the CONTENT   click on my link to the FOOT   

another way is applied directly behind the anchor tag page address, mainly for the anchor between different access pages
If the present page is the address http: // file path /index.html, access to the anchor foot just visit the following links point to
http: // file path /index.html#foot
2.html anchor in the end is why the?
throughThe custom says, for example, a long article, you want to see the segmentation, you can use anchor.

Jump to 001
 ... Text omitted   ... text omitted     Actually, the anchor can only be Name, plus ID is better to make it compatibility. 
HREF’s value is consistent with Name \ ID, you must add “#”, above the above code. In IE6 / 7, it can be compatible in FF, but it will not work in IE8. Because we have anchor

is empty, in order not to affect the beautiful view, we will add a space,
If the following code, it can be compatible with IE8

… Text omitted & nbsp
 ... Text omitted      Another problem , Want to display an anchor content of a page (such as: 123.html)?  

Jump to 001
… Text omitted

& nbsp … Text omitted
   This is when it is doing a background yesterday, I want to achieve "modification positioning", just pull the anchor mark (usually it is forgotten by me).  But the program says that they have to take the value, "?" Or "&" must be "?" Or "&", so my anchor is not compatible ...  Oh! There will be a solution!  Although there is a problem with the anchor point in the JSP page, there is no problem in the static page, or it is worth learning!  3. In web development, the page anchor is used. HTML page Anchors are used to link to a chapter of a page. In W3SChool, it is said that creating an anchor uses the 
(anchor) tag and Name property, butThis is not the only way to create page anchors. The following briefly said two ways to make HTML page anchors. We can use W3School online test tools to test. Test code after opening the link is

, there is no problem with the test. “

Chapter 4
” Change to “
Chapter 4
” is tested, the effect is the same. Instructions, the production page Annimpress can use the ID attribute in addition to the anchor tag NAME attribute. The value of the HREF attribute in the anchor

tag is the value of the Name or ID of the target:

Copy code

The code is as follows:

  page anchor method 2   


using anchor tag

With regard to how to use an anchor in the HTML page, you can share it here, I hope that the above can help you have some help, you can learn more. If the article is good, you can share it out to let more people see.

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment