HTML links
When you click a link in an HTML document, like this: the last page , where the <a> tag uses an href attribute value like this to point to an address on a network: <a href= "lastpage.htm" >last Page</a>
In this example, the last page's link address is relative to the site you are viewing, and your browser will automatically build a complete URL to access this page, such as http://www.w3school.com.cn/html/lastpage.html.
URL (Uniform Resource Locator)
Something called a URL (Uniform Resource Locator) is used to address documents (or other data) on the World Wide Web. A complete URL, for example: http://www.w3school.com.cn/html/lastpage.html, follows the following grammatical rules:
Scheme://host.domain:port/path/filename
Scheme Defines the type of Internet service. The most popular type is http.
domain defines the internet domain name , for example: w3school.com.cn.
Host defines the hosts in this domain. If omitted, the default HTTP-enabled host is www.
:p Ort (port) Defines the port number of the host. The port number is usually omitted. The default port number is .
Path defines the path ( a secondary path) on the server. If the path is omitted, the resource (document) is positioned at the root of the Web site.
filename Defines the name of the document. The default file name is typically default.asp or index.html, or a different file name based on the WEB server settings.
Editor's note: The English name of the URL is Uniform Resource Locator, and Chinese is also translated as "Uniform Resource Locator".
URL schemes
Here are some of the most popular scheme:
Schemes |
Access |
File |
Files on the local PC. |
Ftp |
Files on the FTP server. |
http |
World Wide files on the WEB server. |
Gopher |
Gopher files on the server. |
News |
Usenet newsgroups. |
Telnet |
Telnet connection. |
WAIS |
WAIS files on the server. |
Access Newsgroups
The following HTML code creates a link to a newsgroup:
<href= "news:alt.html">html newsgroup</a >
This link appears as follows:HTML newsgroup
Use FTP for download
The following HTML code creates a link to the download file:
<href= "Ftp://www.w3school.com.cn/ftp/winzip.exe">Download WinZip </ a >
This link appears as follows: Download WinZip
(this link is not working, it's just an example, so there's no need to try.) We do not provide an FTP directory. )
Linking to the messaging system
The following HTML code creates a link to your mail system:
<href= "Mailto:[email protected]">[email protected]< /a>
This link appears as follows: [email protected]