hypertext link

Table of contents

1.Hyperlink tag

2. Functions, attributes and supplements of tags;


1.Hyperlink tag:

<a href=" "> </a>

A hyperlink is an inline element, a special inline element. It can hold anything, including a piece of text, a picture, a table, etc.;

Use of empty connection:

<a href="#">空链接<a>
<a href="JavaScript:;"> 空链接<a>

2. Label functions, attributes and supplements:

Function: 1. Jump from one page to another.

           ​ ​ ​ 2. Jump to the current page (anchor function).

          Anchor function: Add the id attribute to the place where you need to jump, set an id value, then fill in the attribute value in the href attribute, and click to jump to the corresponding position.

Attributes: Fill in the address to be jumped in href;

  Absolute address: As long as you fill in the correct web page, you can jump correctly, and it has little to do with the file itself;

 Relative address: related to the location of the file itself;

 The path of href is similar to the path of img: ./ is in the same directory, and the location to be jumped to by ../ is in the upper-level directory.

      Target attribute: Controls how hyperlinks are opened.

     _self default value, opens on the current page, _blank opens on a new page.

Guess you like

Origin blog.csdn.net/weixin_65607135/article/details/125996149