HTML uses a hyperlink to connect to another document on the network. Links can be found in almost all web pages. Click the link to jump from one page to another. HTML uses the label < a > to set hypertext links. A hyperlink can be a word, a word, or a group of words, or an image that youcan click to jump to a new document or a part of the current document. When you move the mouse pointer over a link in a web page, the arrow changesto a small hand. The href attribute is used in the tag < a > to describe the address of the link. By default, the link appears in the browser in the following form: An unvisited link is displayed in blue font and underlined. Visited links are displayed in purple and underlined. When you click the link, the link appears red and underlined. Note: if the CSS style is set for these hyperlinks, the display style will be displayed according to the settings of CSS. The linked HTML code is simple. It looks like this: Clicking this hyperlink will take the user to the home page of the rookie tutorial. Tip: “linked text” does not have to be text. Pictures or other HTML elements can be links. Use The following line opens the document in a new window: Tip: bookmarks are not displayed in any special way, that is, they are not displayed on the HTML page, so they are hidden from the reader. Insert ID into the HTML document: Create a link to the “useful hint section (id=” tips “)” in the HTML document: Alternatively, create a link from another page to the “useful hint section (id=” tips “): Note: always add a forward slash to the subfolder. If you write the link like this: href= “ https://www.runoob.com/html ”, two HTTP requests will be made to the server. This is because the server adds a forward slash to this address and creates a new request, like this: href= “ https://www.runoob.com/html/ ”. Label Description < a > Define a hyperlink 11.10.1. HTML hyperlinks ¶
11.10.2. HTML Link Syntax ¶
<a href="*url*">*Link Text* </a>
href
property describes the target of the link. . 11.10.3. Example ¶
<a href="https://www.runoob.com/">Visit the Rookie Tutorial</a>
11.10.4. HTML Link-
target
attribute ¶
target
property, you can define where the linked document is displayed. 11.10.5. Example ¶
<ahref="https://www.runoob.com/"target="\_blank"rel="noopener
noreferrer">Visit the Rookie Tutorial!</a>
11.10.6. HTML Link-id attribute ¶
id
property can be used to create a bookmark for an HTML document. 11.10.7. Example ¶
<a id="tips">Useful Tips</a>
<a href="#tips">Accessing useful tips section</a>
<a href="https://www.runoob.com/html/html-links.html#tips">
Accessing useful tips section</a>
11.10.8. Basic precautions-useful tips ¶
11.10.9. HTML Link label ¶