HTML Basics: Linking to Other Pages

How to link to other pages in HTML


All right, it’s time to learn how to link to another page. So let’s start out by seeing what tag we use for linking:

<A HREF=”http://www.someplace.com”>Display Text</A>

The A stands for anchor, and the HREF=” ” is asking for a location to link to. The </A> is the closing tag. The text between the tags is what will show up on your web page as a link. So, if you would like to link to our site, you would place our url, or net address, inside the quote marks. Our url is http://www.yourdomainname.com, so to create a link to us, place this command on the page where you would like the link to show up:

<A HREF=”http://www.blindog.com”>Blindog</A>

It will show up on your page like this:

Blindog

See how the text was colorized and underlined? In most cases, this will indicate the text is a link. If you move your mouse over the link, you should see the cursor change into a pointing hand. The mouse attribute comes in handy when a page has a whole lot of underlined text…..

As another example, let’s create a link to this particular page. Look in your location box near the top of your web browser. You should see the url for this page, which is http://www.blindog.com/blog/html-basics-linking-to-other-pages/317/ . To create the link, insert this url into the link tag:

<A HREF=”http://www.blindog.com/blog/html-basics-linking-to-other-pages/317/”>Linking to Other Pages</A>

Which gives us this link:

Linking to Other Pages

If you click on this link right now, your browser will simply display this page again. If you click on the link from the first example, you will end up at our home page. Great isn’t it? Now, if you want to link to your own pages from your home page, just type in the address for your page inside the link tag. This will work for any page because we are using the absolute url, which means we are using the complete address to every page we are creating a link to. If you have all of your files in the same directory, you may use a shortcut called a “local url”. Before you try this, be certain any file you want to create a local url link to is in the same directory as the page you are editing. (In most cases, it will be) Now, rather than typing the full url inside the tag, you can just use the filename, like this:

<A HREF=”/blog/html-basics-linking-to-other-pages/317/”>Linking to Other Pages</A>

This will create the same link we just did, but we didn’t have to write as much.

Linking to Other Pages

For an email blast you MUST use a full path for links, just like images. If you aren’t sure or have doubts, always use the absolute url. Typing in the full address will allow the link to work no matter where it is located on the internet.

>> NEXT HTML Basics: Using an Image as a Link