HTML and CSS  Home HTML and CSS Tutorials Linking Things Together
rss

Linking Things Together

Author: Jeff Singer More by this author


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 &ltA 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.



Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Linking Things Together"