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

Implementation steps for enabling docker remote service link on cloud centos

Here we introduce the centos server with docker i...

Troubleshooting of master-slave delay issues when upgrading MySQL 5.6 to 5.7

Recently, when upgrading the Zabbix database from...

Some notes on installing fastdfs image in docker

1. Prepare the Docker environment 2. Search for f...

Detailed explanation of redundant and duplicate indexes in MySQL

MySQL allows you to create multiple indexes on th...

Difference between var and let in JavaScript

Table of contents 1. Scopes are expressed in diff...

How to connect Navicat to the docker database on the server

Start the mysql container in docekr Use command: ...

Website background music implementation method

For individual webmasters, how to make their websi...

How to install and configure MySQL and change the root password

1. Installation apt-get install mysql-server requ...

Use CSS content attr to achieve mouse hover prompt (tooltip) effect

Why do we achieve this effect? ​​In fact, this ef...

Detailed explanation of webpage screenshot function in Vue

Recently, there is a requirement for uploading pi...

WeChat applet implements simple chat room

This article shares the specific code of the WeCh...

How to install Nginx in CentOS7 and configure automatic startup

1. Download the installation package from the off...

Vue routing returns the operation method of restoring page status

Route parameters, route navigation guards: retain...