soompi forums: Html Coding Question - soompi forums

Jump to content

Page 1 of 1

Html Coding Question

#1 User is offline   theedqueen 

  • Member
  • Pip
  • Group: Members
  • Posts: 2,756
  • Joined: 04-October 05

Posted 31 March 2007 - 12:20 PM

My website is getting a little cluttered and I wanted to create folders to make things easier to find. But the thing I'm confused on is how I can link items in one one folder to an item in a different folder.

For instance, normally if I have everything in one folder and I wanted to pull up an image all I have to do is:
<img src="image.jpg">

However, if the image isn't in the same folder as the html file I'm using, how should I change that code? Similarly how would you do that to link other html files? Normally I can just stick in <a href="site1.html">Site1</a> and that works fine if everything's in the same place, but I can figure out how to do it is just to put in the entire url of the page.

I've tried googling, but a lot of sites give the basic info on how to link and pull up images and don't go into that much detail. Any help would be greatly appreciated, I hope I made sense biggrin.gif
Posted Image
Still Frames || The Palace --Graphics and Reviews
My LJ account
0

#2 User is offline   thachhao 

  • Member
  • Pip
  • Group: Members
  • Posts: 309
  • Joined: 01-October 06

Posted 31 March 2007 - 12:28 PM

It's not a code, it's basically an understanding of how directory works.


Say you have a folder named "images" that you want to store your image files. You would do:
<img src="images/somepic.jpg">

You would do the same if you want to go more deeper:
<img src="images/2006/august/somepic.jpg">



But if the image file is below the folder that contains the html file:
<img src="../image.jpg">

".." means "below one level"

Again, you can go down even more...:
<img src="../../image.jpg">



And to put them all together:
<img src="../../images/somepic.jpg">

(What this do will go 2 folder down, go into the "images" directory, and access the image file)


Hope this helps. This also applies to <a>
0

#3 User is offline   theedqueen 

  • Member
  • Pip
  • Group: Members
  • Posts: 2,756
  • Joined: 04-October 05

Posted 31 March 2007 - 12:34 PM

yea, I thought it was something like that. I'll give it a try and see if it works. Thanks so much!
Posted Image
Still Frames || The Palace --Graphics and Reviews
My LJ account
0

Share this topic:


Page 1 of 1

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users