HTML web page hyperlink tag

HTML web page hyperlink tag href specifies the link addressname gives the link a nametitle gives the link hint texttarget specifies the target window of the linkaccesskey link hotkeyAbout pathEvery file has its own storage location and path. Understanding the path relationship between a file and the file to be linked is the basis for creating a link. URL—Uniform Resource Locator refers to the independent address that each website has. Every web page under the same website belongs to the same address, but when creating a web page, it is impossible and unnecessary to enter the full address for each link. We just need to determine the relative path relationship between the current document and the site root directory. Therefore, links can be divided into the following three types: Absolute path such as https://www.jb51.net Relative path such as news/default.htm Root path such as /website/news/default.htm
Before understanding these three address forms, you must first understand two other concepts: internal links and external links. Both internal and external are relative to the site folder. If the link points to a file within the site folder, it is an internal link. If the link points outside the site folder, it is called an external link. When adding external links, the absolute addresses described below will be used; when adding internal links, the root directory relative addresses and file relative addresses described below will be used.
The following are the three types of links:
    Absolute path The absolute path provides the complete path for the file, including the applicable protocol, such as http, Ftp, rtsp, etc. The most common ones are:
    http://www.sohu.com
    ftp://202.136.254.1
    When linking to files on other websites, you must use absolute links. Relative paths Relative links are best suited for internal links within a website. As long as they are under the same website, relative links are very suitable even if they are not in the same directory. File-relative URLs are the ideal form of internal links. Relative URLs can be used freely to build links between files as long as they are within the site folder. This address form uses the relative relationship between the two files that construct the link and is not affected by the server location of the site folder. Therefore, this writing form omits the identical part of the absolute address. The advantage of doing this is that when the server address of the site folder changes, all internal links of the folder (if this address format is used) will not have any problems.
    The usage of relative links is: If the link is to the same directory, just enter the name of the document to be linked. To link to a file in the next-level directory, just enter the directory name first, then add "/" and then enter the file name. If you want to link to a file in the upper-level directory, first enter "…/ ", then enter the directory name and file name. Root path root directory relative address is also suitable for creating internal links, but in most cases, it is not recommended to use this address form. It is used in the following situations: When the site is very large and is placed on several servers When several sites are placed on one server at the same time

The writing format of the root directory relative address is also very simple. It starts with a slash, representing the root directory, followed by the folder name, and finally the file name. The root path starts with "/" and is followed by the directory name under the root directory.
Previous Page 1 2 3 4 5 6 7 8 Next Page Read Full Article

HTML web page hyperlink tag learning tutorial link tag attributes link is one of the most important elements in a web page and is the soul of a website. A website is composed of multiple pages, and the navigation relationship between pages is determined by links. Every web page has a unique address, which is called URL (Uniform Resource Locator) in English. Enter https://www.jb51.net in the address bar and press Enter to open the main page of the 123WORDPRESS.COM website. As you can see, there are multiple columns, multiple news items, etc. on the page, and the different columns at the top are text links.
Although the link tag occupies an irreplaceable position in website design and production, there is only one tag, that is, the <a> tag. The link applications introduced on this site are all based on the <a> tag.
The properties of the link tag are shown in the following table
property describe

<<:  Steps to install MySQL 8.0.23 under Centos7 (beginner level)

>>:  CSS techniques for achieving multi-column equal height layout that the front end should master

Recommend

Web Design Experience

<br />The author used to be a novice in web ...

Centos6.5 glibc upgrade process introduction

Table of contents Scenario Requirements glibc ver...

Standard summary for analyzing the performance of a SQL statement

This article will introduce how to use explain to...

CSS style writing order and naming conventions and precautions

The significance of writing order Reduce browser ...

An article to understand the use of proxies in JavaScript

Table of contents What is an agent Basic knowledg...

React's context and props explained

Table of contents 1. context 1. Usage scenarios 2...

How to retrieve password for mysql 8.0.22 on Mac

Mac latest version of MySQL 8.0.22 password recov...

Introduction to the use and difference between in and exists in MySQL

First put a piece of code for(int i=0;i<1000;i...

In-depth understanding of javascript class array

js array is probably familiar to everyone, becaus...

Linux Network System Introduction

Table of contents Network Information Modify the ...

Vue implements calling PC camera to take photos in real time

Vue calls the PC camera to take pictures in real ...