Simple application html <a> anchor tag jump

      Simple application html <a> anchor tag jump

   The most important function is to achieve <a> tag hyperlinks and anchors. Generally speaking generally considered <a> label the most important role is to achieve a hyperlink, but functionally there are other role. So it is to organize the next <a> as an anchor tag href common usage jump on this page.

    We believe that we usually browsing the web page, you often find in the lower right corner or the lower left corner of the page there is a relatively fixed navigation bar, which has a bottom most button at the top of the back.

    Then it is how to achieve it? This time a label can simply achieve this function. For example: <a href="#"> </a>; it represents the most back to the top of the page.

    But again, it's not just confined to the function back to the top. It can also be a return to a node of our page. In <a href="#"> </a>, followed by # to add id. For example, we have a page, which just put an article. Then we set before each paragraph of the article corresponding to the bottom of the article, set a unique id, then we refer to this id in a label. id names can be set according to individual semantic.

When we <a href="# xx"> </a> (xx set a good position on behalf of each id); referencing. So when we browse the page, at the bottom of a label corresponding to the jump button to jump to the corresponding id before each jump paragraph.

    As an anchor, its role, there are many, the film aims to explain the contents of the node back to the top and jump. More Features will tell you about in subsequent articles.

    

Guess you like

Origin www.cnblogs.com/CWJDD/p/10954105.html