URLs
HTML uses the
<a> (anchor) tag to create links. When you make a link, you are making a clickable anchor text or image. When somebody click on this text or image, it will take them to another web page. Let's say that you wanted to make a link from your web page to Google. You would type:
<a href="http://www.google.com">Google</a>
The output is:
Google
The targeted Attribute
With the targeted attribute, you can define
how the linked web page will be opened. You can let the browser displays the linked web page in a new window with
target="_blank" attribute.
For example, let's open the Google web page in a new browser window:
<a href="http://www.google.com/"
target="_blank">Google</a>
The output is:
Google
You can go ahead and try it if you want to.
Link to Specific Sections
Sometimes, you might want to have a link to take you to a specific section of another page. To do this, you need to do two things. The first, is to make the link, and the second, is to make where the link will lead to.
1) To make the actual link, think of a name for the certain spot. Let's say you are going to call it "spot". If this certain spot is on the same page that the link is, you would type:
<a href="#spot">Link to the spot section</a>
2) Now, you need to make where the link will take you. Go to the spot where you want the link to take you, and type:
<a name="spot"></a>
Mailto Links
Most people like to have a link on their web page that automatically sends e-mail to an address. If you want to do this, and your name is Dan, and your e-mail address is a@a.com, type:
<a href="mailto:a@a.com">Dan</a>
Here is the result of typing this:
Dan
Add to Favorite Link
A popular feature you see on various sites is a link that allows you to add the web page to your browser's favorite menu. If you want to do this on your site, type:
<a href="javascript:window.external.AddFavorite(location.href, document.title);">Add this Page to your Favorites</a>
The output is:
Add this Page to your Favorites
Print this Page Link
Another popular feature you see on various sites is a link that allows you to print the web page. If you want to do this on your site, type:
<a href="javascript:window.print();">Print this page</a>
The output is:
Print this Page
You can go ahead and try it if you want.