4) Linking: URL - Uniform Resource Locator
4) Linking: URL - Uniform Resource Locator
scheme://host.domain:port/path/filename
Explanation:
scheme - defines the type of Internet service. The most common type is http
host - defines the domain host (the default host for http is www)
domain - defines the Internet domain name, like w3schools.com
:port - defines the port number at the host (the default port number for http is 80)
path - defines a path at the server (If omitted, the document must be stored at the root directory
of the web site
filename - defines the name of a document/resource
Example
<a href="http://www.w3schools.com/">Visit W3Schools</a>
which will display like this: Visit W3Schools
Links Attribute
The target Attribute
The target attribute specifies where to open the linked document.
The example below will open the linked document in a new browser window:
Example
A named anchor inside an HTML document:
Create a link to the "Useful Tips Section" inside the same document:
<a> (Anchore)Tag
Example
A link to W3Schools.com:
Definition
The <a> tag defines an anchor. An anchor can be used in two ways:
The <a> element is usually referred to as a link or a hyperlink.The most important attribute of the <a>
element is the href attribute, which indicates the link’s destination.
Optional Attributes
Attribute Value Description DTD
rel text Specifies the relationship between the current document STF
and the linked document
rev text Specifies the relationship between the linked document STF
and the current document
Mailto anchor
The mail to is used to send electronic mail. If browser support mailto URL & make a
link to some text to mail with anchor by using mailto send message to the appropriate adderss.
Syntax: mailto:e-mail adderss
Example:<a href="mailto:[email protected]>
<html>
<body>
<p>
This is an email link:
<a href="mailto:[email protected]?Subject=Hello%20again">
Send Mail</a>
</p>
<p>
<b>Note:</b> Spaces between words should be replaced by %20 to ensure that the browser will display
the text properly.
</p>
</body>
</html>
Note: Spaces between words should be replaced by %20 to ensure that the browser will display the text
properly.