Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3 - Links

HTML Crash Course

3 - Links

by  Javrix  Posted    (Edited  )
***Note on this page that the ; character on the end of the codes is inserted by Tek-Tips and is NOT part of the code.

Quick review:
We know the basic structure of web pages:

<HTML>
<HEAD>
<TITLE>Title</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" TEXT="000000" LINK="00FF00" VLINK="CCCCCC" ALINK="C0C0C0">
Text text text
</BODY>
</HTML>

In this section we're going to look at links, and ONLY links.
But before we get started, there's a few things I forgot to mention in the other sections.
First, our tags don't need to be in caps. I do it to look nice and neat, but you can do it anyway you'd like.
<HTML> <HtMl> <html> are all the same.

So, what is a link and how does it work?
Hyperlinks, or just links, are what make the internet go round.
Let's take a look at how a link is writtin in HTML:

<A HREF="http://www.mypage.com">This is the link to mypage.com</A>

Ok, let's rip this apart.

The A in the above code means Anchor. Anchor's are the base for our links. Anchors are used not only for links, but we'll just focus on the link part for now.
We tell the page we're making an anchor here <A> and we're going to end it here </A> and anything inbetween the two is what the anchor does.

The HREF is the actual code that links us. HREF actually means Hyper Reference. So in this case we Hyper Reference to http://www.mypage.com.
Although the quotes aren't required, it's a good practice because you'll soon be using quotes a lot.

So let's take a step back and look at it.

<A (the anchor starts) HREF="http://www.mypage.com"> (this is what the anchor will do, it will reference us to mypage.com) This is the link to mypage.com (this is inbetween the anchor's, so when someone clicks on it, it will reference them to mypage.com) </A> (stops the anchor code)

This is the basis for all links.

Let's leave it at that and move on...

***Remember, Tek-Tips is adding a ; character to each link.
So the code:
<A HREF="http://www.mypage.com">text</A>
Is correct without the ; at the end of mypage.com
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top