Talking about the <a href=" "target=" ""> </a> link label

Link tags <a>are usually used for page jumps, which have two main attributes, href and target.

href is used to specify the address of the link content. It is a necessary attribute of the hyperlink tag. When the href has a value, the hyperlink tag has the function of a link.

target is used to set the opening method of the linked webpage. When the target value is "_self", it means that the linked webpage is opened on the current page, and when the target value is "_blank", the linked webpage will be opened in a new window.

Below, introduce several common usages of links:

1. External link: the URL whose link address is the target , such as<a href="https://www.bilibili.com">b站</a>

2. Internal links: refer to the jump between the internal pages of the website. At this time, you only need to fill in the name of the jumped web document after herf.

3. Empty connection: In the actual development, but we have not yet determined that the linked website can be represented by href="#", and when the linked website is determined in the future, change "#" to the corresponding website. The meaning here is that there is a link in this place, but it is still ok, and it will not jump when we click.

4. Download link: When the link address in href ends with .exe or .zip, it means the link is a program or compressed package. Clicking on this link will automatically download related content

5. Web page element links: All elements in a web page can be links, such as text, pictures, tables, etc.

6. Anchor link: When we click on the link of the corresponding cat, the webpage can quickly slide to the relevant position. (This technique is commonly seen in Baidu Encyclopedia)
Implementation steps:
a. Select the anchor point and make href="#XXX (XXX means that you can set a value arbitrarily)"
b. Select the target location and add an id attribute to the tag of the target location , Make its value equal to "XXX", where "XXX" must be the same as "XXX" in href.

Guess you like

Origin blog.csdn.net/m0_52021758/article/details/112961837