Free Webmaster Resources .info
PHP Introduction and Tutorials Javascript  Introduction and Tutorials HTML  Introduction and Tutorials ASP  Introduction and Tutorials Free Internet Access Guide and Directory Webspace  Directory Webhosting  Directory Adult Webhosting  Directory PHP Hosting  Directory ASP Hosting  Directory
à Navigation
» Home
» Html Introduction
» Html Tutorial
» Html and CSS
» Submit Scripts
 
Subscribe for free!

Join our mailing list today and recieve free updates monthly with web hosting specials!
 
 

 

 

Free Webmaster Resources .info | Html Tutorials

Html and WWW Html Frames
Html Elements Html Tables
Html Basic Tags Html Lists
Html Formatting Html Forms
Html Entities Html Images
Html Links Html Background

HTML Links

HTML uses a hyperlink to link to another document on the Web


The Anchor Tag and the Href Attribute

HTML uses the <a> (anchor) tag to create a link to another document.

An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc.

The syntax of creating an anchor: 

<a href="url">Text to be displayed</a>

The <a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink.

This anchor defines a link to free-html-scripts.com:

<a href="http://www.free-webmaster-resources.info/">
Visit free html scripts!</a>

The line above will look like this in a browser:

Visit free html scripts!


The Target Attribute

With the target attribute, you can define where the linked document will be opened.

The line below will open the document in a new browser window:

<a href="http://www.free-webmaster-resources.info/"
target="_blank">Visit free html scripts!</a>


The Anchor Tag and the Name Attribute

The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specified section on a page, instead of letting the user scroll around to find what he/she is looking for.

Syntax of a named anchor:

<a name="label">Text to be displayed</a>

The name attribute is used to create a named anchor. The name of the anchor can be any text you care to use.

The line below defines a named anchor:

<a name="tips">Read the Useful Tips section</a>

You should notice that a named anchor does not display in a special way.

To link to the named anchor you add a # sign and the name of the anchor to the end of the URL, like this:

<a href="http://www.free-webmaster-resources.info/
html_links.asp#tips">Read the Useful Tips section</a>

The line above will take the user straight to the text within the anchor <a name="tips">... </a> within the file "html_links.asp".

A hyperlink to the Useful Tips section from within the file "html_links.asp" will use this syntax: 

<a href="#tips">Useful Tips</a>


Basic Notes - Useful Tips

Always add a trailing slash to subfolder references. If you link like this: href="http://www.free-webmaster-resources.info/html", you will generate two HTTP requests to the server, because the server will add a slash to the address and create a new request like this: href="http://www.free-webmaster-resources.info/html/"

Named anchors are often used to create "table of contents" at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.

If a browser cannot find a named anchor that  has been specified, it goes to the top of the document. No error occurs. 


Link Tags and Targets:

NN: Netscape, IE: Internet Explorer, W3C: Web Standard

Start Tag NN IE W3C Purpose
<a> 3.0 3.0 3.2 Defines an anchor

Target Attributes Purpose
target="_blank" Loads the new document in a new blank window
target="_self" Loads the new document in the same window as the anchor (default)
target="_parent" Loads the new document in the parent frame (when using frames)
target="_top" Loads the new document in the entire browser window (nice way to break out of frames)


Recommended Webhosting Company
Find free web hosting
Looking for free web hosting? Review and compare FindStuff's comprehensive resources. Search now!

 

 
Related Websites
 


Free Email
Your source to free email.

Free Casino Downloads
Contains useful free casino downloads.

Free Software Downloads
A complete collection of free software downloads.

Free
Download free stuff from psike.com your free stuff resource.

Free Teen Online Dating
Meet other singles for free online dating.

Coolfreeweb.com
The Free category at coolfreeweb.com

My Directory Listing
A massive directory listing of websites

Website Collation Project
The website collation project contains a huge directory of websites.


 
Top Webhosts
 
 1. Find free web hosting
 2. Free Web Hosting
 3. Web Hosting
 4. Find: Hosting Review &a
 5. Hosting
 
-
- Give us feedback
 
Last updated
Jan 03, 2009
Free Webmaster Resources .info | A resource must for every web master
Untitled Document - Web Hosting
- PHP Hosting
- Free Internet Access