Example HTML Code
<a href="index.html">Link to Index</a>
Example HTML Code as it would be rendered.
If this tag looks simple to use that's because it is -- at least in this simplified form. Just ignore the other options (for the moment) and this tag becomes simplicity itself. Which is very fortunate because it is a most important HTML tag without which you could not jump from page to page. It is this tag that give the web its webness and hypertext its hyper. Long live the href tag.
Okay, so maybe that is a bit on the over enthusiastic side. But just wait until you link a few pages together into a mini-website. See how excited you get.
- <a href=URL>
- This tag is totally essential in the creation of webpages. It is technically known as the hypertext link do-hickey. Without this do-hickey we couldn't link from page to page.
There are several attributes used in conjunction with this tag. For the moment we shall ignore all of them and just use the basic simple form of:
- <a href="filenametolinkto.html">
This is the most essential and will get ya going.
Some tags that we really should study right away but are just a little more confusing that we expect to learn today are the following:
- TARGET=" " -- this can be a rather important attribute. At the moment you can't be expected to have the background to use this attribute well. Let's get back to this in a short while when we discuss frames.
- Name="text" -- used to establish links from one point of a page to another point within the same page. Or, used to jump into the middle of another page. Let's study this one soon but not today.
- href="mailto:email@example.com" -- used to allow voyagers the option of sending you an immediate email message. Very useful. We'll cover it soon.
Attributes that we shall try to avoid discussing as long as possible are:
- gopher:// -- used to link to a gopher session. Like who even remembers what gopher is anymore?
- news:// -- used to link to newsgroups. Like almost all the newsgroups are taken over by pornography, flame wars, or spam. And, besides why not let folks read the news group in their favorite news reader? Out of the thousands and thousands of webpages I've scanned I've only seen a hand full that use the news:// to any value. Might as well ignore it for the moment. You're only on lesson 5 for goodness sake. There is plenty of time later to worry about this.
- TITLE="text" -- used to give a title to the link. Not supported by all browsers, and not all that necessary in any case. Check this one out in a week or two or maybe in a year when it's better supported.
- REL=text1,text2 -- used to specify the relationship(s) of the link to the current page. If you aren't working on an industrial strength website feel free to ignore this attribute.
- REV=text1,text2 -- used in a similar fashion as "rel" only in reverse. Ignore this one even more.