HTML hyperlinks

  Link is one of the basic features of the HTML document. Hypertext links English name hyperlink, which allows the browser to easily jump between each individual page. Hyperlinks external links, email links, anchor links.

a label

  Web page <a>tags, full name: anchor, the anchor of meaning. It called hyperlinks in html tag, you can say it in a web page is everywhere, as long as there is a link place, there will be the label.

Open Link

<a>Label By default, linked pages is open in the current browser window, and sometimes we need to open in a new browser window. At this time we can set targetto change the parameters.

Such as<a href='目标地址' target='打开方式'>百度一下</a>

targetThere are four parameter values:

_self: open the current page link

_blank: Open link in a new blank window

_top: Open the link in the top frame, can also be understood as a framework to open a link in the root

_parnet: the current framework in a link layer in the open

Note that each parameter name underlined before _, it is easy for beginners to miss

Outside site

The syntax is<a href='目标地址' title='鼠标滑过显示的文本'>链接显示的文本</a>

For example, we we have to be results. Click on Baidu, will jump to Baidu's home page.

<a href="http://www.baidu.com" title='点击进入百度' target='_blank'>百度一下</a>

  1. href refers to the address of a link to a page
  2. The role of title property, it will display the text content of this attribute when the mouse over the link text. This property has little role in the development of the actual web page, mainly to facilitate search engines understand the content of the link address

Note: The text added to a label, the color of the text will automatically change to blue, but can be set via css styles.

Mail Links

On many pages we can see the Contact Us this button, then click enter is send an e-mail window.

Code<a href="mailto:邮箱地址" target='_blank'>联系我们</a>

Anchor link

Anchor links can be understood as a jump or move quickly, such as we see in some sites a 回到顶部button, tap it back to the top of the page. For example, you are now looking at the top right blog, it is an anchor link.

Establish anchor

Anchor point is that you need to jump to that position, the first step is to create anchor link to create an anchor

The syntax is<div name='top'>顶部</div>

Put it more bluntly, is to give a label named here is to give <div>the label name, you can give the same <table>, <ul>and other labels naming it as an anchor.

Link anchor

The syntax is<a href="#top">回到顶部</a>

#+锚点名That is, you want to jump to an anchor

Guess you like

Origin www.cnblogs.com/aqiao/p/11904791.html