Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set hyperlinks in HTML

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to set up hyperlinks in HTML". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to set up hyperlinks in HTML.

Preface

HTML uses tags to set hypertext links.

A hyperlink can be a word, a word, a group of words, or an image that can be clicked to jump to a new document or to a part of the current document.

When the mouse pointer moves over a link in a web page, the arrow becomes a small hand.

The href attribute is used in the tag to describe the address of the link.

HTML hyperlink syntax

Link text

The href property describes the target of the link

Note: link text is not necessarily text, it can be pictures or other HTML elements.

HTML Link-target attribute

Using the target property, you can define where the linked document is displayed.

For example, open Baidu in a new window:

Click to visit Baidu

HTML Link-id attribute

The id attribute can be used to create bookmarks in an HTML document. Common portals such as "back to the bottom", "back to the top" and so on are generally implemented through the id attribute.

For example:

Insert ID in the HTML document: top

Create a hyperlink to the "top" in the HTML document: go back to the top

Or, to create a hyperlink from another page to the top of the page, you need to create a link first, and we'll talk about it later.

Basic considerations for hyperlinks

Always add a forward slash to the subfolder. If you write the link like this: href= "https://www.baidu.com", 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.baidu.com/"

HTML hyperlink tag

Define a hyperlink

At this point, I believe you have a deeper understanding of "how to set up hyperlinks in HTML". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report