12:08:29 AM
Thursday
Sep 09
Su M Tu W Th F Sa
567891011
12131415161718
19202122232425
262728293012
3456789

Play My Typing Game

View Some of My Artwork

Deciding your path to the file
Its good to know that both the A tag and the IMG tag can use either local or remote files.

An example of referencing a file thats on a remote server is this syntax: (this is known as an absolute address)
<img src="http://www.website.com/some_folder/some_image.jpg" alt="" />


The time it takes your page to load is directly affected by the number of HTTP requests that occur. So, if you're hosting your page on a live webserver you can make things more efficient by referencing your file by relative path. When a relative path begins with a slash, it means to begin from the root folder your domain starts in.
<img src="/images/file.jpg" alt="" />


When the beginning slash is not present, the rules of beginning at the domain level no longer apply. Instead the browser will be looking for the file as a relative distance from the folder that the page is currently in.
<!--
let's imagine this page is at
http://www.webpage.com/index.html
and we want to access an image located at
http://www.webpage.com/picture.jpg
we'd need to use the following syntax
-->

<img src="picture.jpg" alt="" />
<!--
now, let's imagine this page is still at
http://www.webpage.com/index.html
but we want to access an image located in the images folder at
http://www.webpage.com/images/picture.jpg
we'd relatively walk in to the subfolder of where our page is at with this syntax:
-->

<img src="images/picture.jpg" alt="" />
<!--
now, let's imagine this page is at http://www.webpage.com/some_folder/another_folder/the_page.html
and we want to access an image located at http://www.webpage.com/images/picture.jpg
we'd need to use the following syntax
-->

<img src="../../images/picture.jpg" alt="" />
 


    So, we've discussed
  • when to use an absolute URL that begins http://

  • when to start with only a / (start at the domain)

  • when you don't start with a slash (destination is in the current folder, or its a folder or more deeper from where your webpage is)

  • when you need to start with ../ to go up a folder level from where your webpage is



Read Previous:
Using CSS to turn off border and define dimensions
Read Next:
Image Maps - multiple links on a single image
Table of Contents


Give a listen to my music...
My Best Recordings
How my services and skills can help you:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local
    • Most all the above, but also:
      • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
      • Recording Live Music Audio
      • Video Streaming live music and other live events anywhere that can provide wifi
      • Training Video Streaming to your venue's trusted soundperson
Skills:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local, Most all the above, but also:
    • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
    • Being your venue's soundman
    • Video Streaming live music and other live events anywhere that can provide wifi
    • Training Video Streaming to your venue's trusted soundperson