Website Beginner for wanna be web designers

     


Hyperlinks (a.k.a. Links)

How do you make a link?

<a href=""></a> This is a hyperlink (without a destination). It links to a file or directory.

In use, the code looks like this:

<a href="http://www.benandjerrys.com">Yum, Ice Cream!</a>

And comes out like this: (just remember your back button, ok?) Yum, Ice Cream!

Relative Links

If you link to pages within your own website, you can use Relative links which look like this:
<a href="text.html"></a> . Notice how it doesn't have "http://www." at the beginning? That tells the browser that you're staying in the current domain.

If you want to link to a page in a different directory, say "coolpages", you'd add the directory name to the address, like this: <a href="coolpages/superpage.html"></a>

Let's say you're at "coolpages/superpage.html" and you want to link back to a file in your root directory. You'd use 2 periods and a slash ../ to get out of the current directory, like this:
<a href="../text.shtml"></a> That moves us out of the "coolpages" directory into the next one up (in this case, back to the root).

Are you 2 directories in? Just use ../ twice: <a href="../../text.shtml">. You get the idea.

One last thing about relative links, you can have your link relative to the root, so you don't have to deal with these ../ at all. Just put a single slash before the filename, like this:
<a href="/text.shtml"></a>
and that means that no matter what directory you're in, you'll be linking to a file in the root directory.

So remember: without the slash, you're linking to a file in the current directory, with the slash, you're linking to a file in the the root directory, and ../ (2 periods and a slash) will take you out of the current directory to the next one up.

Absolute Links

When linking to a page on a different domain, you need to add "http://www." to the destination, like this <a href="http://www.fishpie.com"></a>. That's called an Absolute Link.

Anchor Links

Anchor links are cool little dittys that take you to a specific place on a page, very often to the top. Let's make one now: <a href="#top">Top</a> which comes out to be this: Top

We don't have to define "top" as going to the top of the page because that particular anchor is already standardized to do that, but let's say we want to add an anchor to the bottom of this page and we'll call it bigbottom. We'd make an anchor like this:
<name="bigbottom">Ya Found Me!</a>
, and put it way down at the bottom of our page.

Then, to make a link to that anchor, we'll put this: <a href="#bigbottom">Big Bottom </a> right here: Big Bottom (click it and see where it takes you).

Now, let's move on to Tables...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ya found me!

Now take me back up the page!!

 

 



Basic HTML Stuff

Tables
Text & Fonts
Web Graphics
Web Page Design
CSS & SSI
Web Hosting & Domains
Search Engines & How To Make Money With Your Website

Our Book Store
Home

Tell a friend
about this site!


Join our email list for
article alerts and news.


Subscribe
Unsubscribe



Your email will not be
shared with anyone
and is ONLY for
use by this site.


Questions? Comments?