HTML Advanced Tutorial (7)--html URL (Uniform Resource Locator)

Source: Internet
Author: User
Tags gopher

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.