HTML Links In Plain English

HTML links. The heart and soul of web pages. Without links it would be impossible for a visitor to get from one web page to another, meaning that without HTML links, web pages would be pretty worthless.

Everyone at one time or another, has received an email and inside of it they see something that says "click on me" and then when they do they are transferred from the email they received to some web site. What they clicked on was a link. Most email programs allow for HTML or at the very least, links, so that a person can get from their email to a web page.

Once at the page, the real navigation around the site begins, that is unless the page is the only page in the site. In that case there probably won't be any links for the visitor to click on from that point. But in most cases, this page is just the beginning.

In HTML, links are designated by the [a] tag. The action of going from one web page to another is called hyperlinking.

The main part of the link tag is the href attribute. This is where the actual address of the destination or target web page is placed. It is very important that the address of the web page is spelled exactly as it should be otherwise the visitor will end up with a message that the page can't be found, or what is called a 404 error. HTML compilers are stupid. They don't know what you mean. They only know what you tell them. So if the site you're supposed to designate in the href is www.mysite.com and you spell it www.mysits.com, the compiler is going to look for what is spelled and not what you meant to spell.

Another useful attribute is the target attribute. This is where you can designate where the new URL will be displayed. This is useful for when you don't want the original web page to close when the visitor goes to the next page. This is handled by designating target=_blank. This way a new blank browser window will open and then the new URL or web page will be displayed, leaving the page the visitor came from still open. This way they can go back to it easily.

One thing that is great about links is that you don't have to display the whole URL to the visitor for them to click on. For example, let's say the web page has an address of www.gototheheadoftheclassandgiveanappletotheteacher.com. That's kind of a long URL and a visitor might get dizzy looking at it. Easy to fix. Even though you have to pass the actual web address in the href to the browser, in between the opening and closing [a] tags you can place a visual text something like "click here" for the visitor to see. This makes it very easy for the visitor to see that there is a link for them to click on in order to go to the next web page and at the same time they don't have to look at something like the monster web address we just typed.

Yes, links are the heart and soul of HTML. Without them, a web page would just be a pretty picture that nobody would see.

Michael Russell - EzineArticles Expert Author


-------------------------------------------------------
Michael Russell
Your Independent guide to HTML
-------------------------------------------------------