Home>Article>Daily Programming> Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video)

Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video)

藏色散人
藏色散人 Original
2018-09-11 16:15:20 8194browse

This article mainly introduces to youHyperlink anchors in HTMLHow to add settings and what their functions are.

The concepts of HTML hyperlinks and anchors, I believe most of my friends already know it very well, but for newbies who are just getting started with html, how to addhtml This issue of hyperlink anchormay still be a little unclear. So this article is introduced for novice friends. I hope it will be helpful to those who need it!

Below we will explain it in detail through specific HTML code examples.

The code example for adding hyperlink anchors in HTML is as follows:

     
PHP中文网 第一篇文章 第二篇文章 第三篇文章

第一篇文章

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

第二篇文章

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

第三篇文章

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

这是一段文章内容

回到顶部

In this code, we mainly use thein HTMLTag, when we directly add thehref="link address to jump to"attribute directly in the a tag, we can implement a text hyperlink. For example, the above code sectionPHP Chinese websiterealizes that when you click on the field of PHP Chinese website, you can jump directly to The specified link page.

When we add thename="#anchor name"attribute in the a tag, it means that theanchor linkis set. Then in the body text, you can set the anchor point at the specified position, that is, addname="anchor name"in the a tag. Be careful not to add the # symbol here.

Then the above code, the overall effect is as follows:

Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video)

Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video)

Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video)

##When there is a large section of article content in a page, we can quickly jump to the specified object by setting an anchor point on the page. As shown above, when we click on the first article, second article, and third article respectively, we will quickly jump to the specified content part. At the same time, we can add a hyperlink back to the top at the bottom of the article, just set the href attribute value in the a tag to empty!


This article is about the specific method and function of adding hyperlink anchors to

HTML, so what do you think aboutanchor links and ordinary hyperlinksYou should also have a certain understanding of the difference. The above content is very simple and easy to understand. I hope it will be helpful to friends in need! You can also refer to the correspondingVideo Tutorial[Add hyperlinks in HTML and go wherever you want in the anchor page] for reference.

The above is the detailed content of Detailed explanation of the methods and functions of adding hyperlinks and anchors to HTML (with video). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn