Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials Linking Things Together

Linking Things Together


The <A HREF> & <A NAME> Tags

<A HREF="http://bignosebird.com:80/index.shtml#SSEARCH">search</A>

The <A HREF> is the tag that glues the Web together! This is how you provide links to what are called URLs (Uniform Resource Locator). These typically are pages and images.

In the example above, the worst case scenario is given:

  • http://bignosebird.com indicates the server name.
  • :80 means TCP/IP port 80 (the default for HTTP)
  • index.shtml is the page being requested.
  • #SSEARCH means go to the <A NAME="SSEARCH"> anchor tag on index.shtml

Linking Things Together

Normally, links to pages on another server are called in the form:

<A HREF="http://bignosebird.com/index.shtml">click</A>

When referencing a page on your server:

<A HREF="/index.shtml">click</A>

The leading slash (/) indicates the absolute path relative to your document root directory. You can also use relative paths:

<A HREF="testdir/index.shtml">click</A>

To allow people to link to arbitrary points of your pages, do the following. Create the tags <A NAME="TAGNAME"></A> in the desired point of your page.

Then create links to it such as:

<A HREF="/pagename.html#TAGNAME">click here</A>

Note: ALL <A HREF> tags MUST be closed with a </A> tag.


Author's URL: Jeff Singer
Learn HTML step-by-step from A to Z or improve your professional skills. More Tutorials: Featured Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

No comments yet...
Add comments to "Linking Things Together"

Captcha