HTML and CSS Reference
In-Depth Information
Here clicking on the text “About” will open the about.html page inside our browser.
Clicking the text “Google,” on the other hand, will open
within our browser.
Click here to view code image
1. <!-- Relative Path -->
2. <a href=" /about.html ">About</a>
4. <!-- Absolute Path -->
5. <a href=" ">Google</a>
Linking to an Email Address
Occasionally we may want to create a hyperlink to our email address—for example, hy-
perlink text that says “Email Me,” which when clicked opens a user's default email client
and pre-populates part of an email. At a minimum the email address to which the email is
being sent is populated; other information such as a subject line and body text may also be
To create an email link, the href attribute value needs to start with mailto: followed
by the email address to which the email should be sent. To create an email link to ,
the href attribute
be .
Additionally, subject, body text, and other information for the email may be populated. To
add a subject line, we'll include the subject= parameter after the email address. The first
parameter following the email address must begin with a question mark, ? , to bind it to the
hyperlink path. Multiple words within a subject line require that spaces be encoded using
%20 .
Adding body text works in the same way as adding the subject, this time using the body=
parameter in the href attribute value. Because we are binding one parameter to another
we need to use the ampersand, & , to separate the two. As with the subject, spaces must be
encoded using %20 , and line breaks must be encoded using %0A .
Altogether, a link to with the subject of “Reaching Out” and body
text of “How are you” would require an href attribute value of
Click here to view code image
Here's the full breakdown:
Search WWH ::

Custom Search