<<< HOME


HOW DO WE MOVE FROM PAGE TO PAGE ON THE WEB?

The very idea of the Web depends on one notion: the HYPERLINK, it's the "H" in HTML. It's the idea that anywhere in a body of text, a word can be made a hyperlink, and take the user to more information.

The idea is refined as a LINK, which can be placed on any number of objects, from text to images to code, that take users to other sites or pages or even sections of pages.

A link in HTML is called an "anchor reference" or as a tag <a href=""></a> (an anchor is what a link is attached to on the other end). Fill in a URL between the attribute quote marks anything you place these begin and end tags around becomes a link to that URL. Neat.

HOW DO WE FIND STUFF ON OUR SITE?

    There are 2 basic kinds of addresses where we can go from one page to another, or where we can locate assets for our pages:
  • Absolute URL: goes to a specific Web location, like http://www.amazon.com.
  • A relative URL or Path: an address that depends on where you are to work.

Let's say I have an image asset in my server that I want to include on a page. I need to give it's address, right?

Let's say again the image file, "mypic.jpg", is at my site, < bobthedog.com >, in a folder on the first level called "images".

Now I could use the absolute URL on my new page "newpage.htm" and call for the file like this, in the most formal way: ABSOLUTE URL:

<img src="http://www.bobthedog.com/images/mypic.jpg" />

See? The absolute URL will not fail, not matter what page its on. In my new HTML page, I've asked the browser to out into the wide Internet, using HTTP, go to the name server to resolve the domain name to an IP address, go to my host server, find the file called "images" and load the image. And absolute URLs are very long to write out each time.

Let's say, though, that my new HTML page is at the same site in a folder called "pages", I could just link the page to the image with a little short bit of code. The page will ask the browser to stay at the same server, back out of the "pages" folder, enter the "images" folder and load the image on the page: RELATIVE URL:

<img src="../images/mypic.jpg" />

Obviously, if I move my new page into another folder, this address will be nonsense and I'll get an error message. That's why it's relative, because finding the path to the image is dependent on the location of the page. The learning curve is steeper, but relative URLs are what Web professionals use, because if you're know what you're doing, they make writing code much faster.

site diagram