Learning tutorial on html web page hyperlink tagging
Properties of link tags
Links are one of the most important elements in web pages and are the soul of a website. A website is composed of multiple pages, and the pages rely on links to determine the mutual navigation relationship. Each web page has a unique address, which is called url (uniform resource locator: universal resource identifier) in English. Enter http://www.VeVb.com in the address bar and then press Enter, which will open the main page of the web teaching website. You can see that there are multiple columns, multiple news, etc. on the page, and the different columns at the top are text links.
Although link marks occupy an irreplaceable position in website design and production, there is only one mark, that is, the <a> mark. The link applications introduced on this site are based on the <a> tag.
The properties of the link tag are shown in the table below
About the path
Each 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—Unified 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 not necessary to enter a complete address for each link. We only need to determine the relative path relationship between the current document and the site root directory. Therefore, the link can be divided into the following 3 types:
For example, http://www.VeVb.com
Such as news/default.htm
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 site folders. If the link points to files 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 address mentioned below will be used; when adding internal links, the relative address of the root directory and the relative address of the file mentioned below will be used.
The following are the three links:
Absolute paths provide complete paths to files, including adapted protocols, such as http, ftp, rtsp, etc. Common ones are:
http://www.sohu.com
ftp://202.136.254.1
When linking to files in other websites, absolute links must be used.
Relative links are most suitable for internal links of the website. As long as it is under the same website, even if it is not in the same directory, relative links are very suitable. File relative addresses are an ideal form of writing internal links. As long as it is within the site folder, the relative address can freely build links between files. This form of address uses the relative relationship between the two files that build the link and is not affected by the server location of the site folder. Therefore, this writing form omits the same part in the absolute address. The advantage of this is that when the server address where the site folder is located changes, all internal links of the folder (if this address form is used) will not have any problems.
The relative link is used as:
The relative address of the root directory is also suitable for creating internal links, but in most cases, this form of address is not recommended. It is used in the following cases:
The writing form of the root directory relative to the address is also very simple. First, start with a slash to represent the root directory, then write the folder name, and finally write the file name. The root path starts with / and then the directory name under the root directory.