Creating Links

All web pages are created by using at least a few simple tags. It is my belief that the three most natural tags to use in an HTML document are the tags for paragraphs, linking sites together, and displaying images.

Links

Lastly, the most vital inclusion to any web page should be an anchor tag, or link, to another web site. This is why, and how, the web was created in the first place. Without the use of linking one page to another you would have to know the exact address of each and every web page on every server in the world to be able to view it. Not only that, but you would have to type in the address manually for a new page to be viewed on your browser.

The anchor element is actually quite small, but it is most often used with its href attribute (hyperlink reference). It may also be used with the name attribute, but I'll let you research that separately. The href attribute contains the url (full web address: http://www.yahoo.com) of the page that you wish to link to. The text with the tag couplet is what the user will see as the link.

A typical link may look something like this:
<html> <head> <title>HTML for Beginners - Basic HTML</title> </head> <body> <a href="http://www.yourdomain.com/">Click to be taken somewhere</a> </body> </html>

And will produce Click to be taken somewhere

«...Adding Pictures Add Headings...»

Advanced Tips

Just like images, you can link to local files or pages stored somewhere else on the internet. If the file is on the same server, you can call it using a relative file path. Think of this like talking to someone with a walkie-talkie radio. You don't need to know exactly where they're at to talk to them. If both files are in the same folder you can just enter the filename as the href or src value, "filename.html".

If the file is still on the same server, but in a different folder, you can still use relative file paths. Use the "../" command to tell the server to look one folder up. This can then be followed by either the filename or the rest of the path to the file. "../page.html" would tell the browser to look one folder up, then find page.html. "../images/image.jpg" would tell the browser to go one folder up, then find the images folder and look inside it for image.jpg.