Forum Moderators: open
This is a total newbie HTML question I have here for you. All the sites I have built in the past have all been small and in the root directory. I am working on some new sites that I would like to setup a directory structure now. Have a couple of questions.
1. Image linking
Ok say I have www.mysite.com. In my root directory I have an images folder. Obvously when linking in the root directory i just use <img src="images/logo.jpg" alt="logo" />. Ok now lets say im on my page of my site at www.mysite.com/news/article1.html. The images folder is not in my news folder. And <img src="images/logo.jpg" alt="logo" /> doesnt work because of the confused directory structure. How can i link backwards one directory to the images folder in the root?
2. Page linking
Similar to situation above. I have a main menu nav bar on the left linking to link1.html, link2.html, link3.html, etc. This menu appears on all pages on my site. Now when someone navigates into the news directory the links dont work. Im using the same <a href="link1.html">link1</a> code as i do out of the root directory, and I can see why its not working because now its looking for the link1.html in the news folder. How can I backwards link also with these main menu links?
I hope this makes sense, thanks for any help you can provide explaining how to handle this.
Thanks
TyWebb21
[edited by: TyWebb21 at 6:36 am (utc) on Dec. 11, 2008]
1. directory relative linking: precede the url with ../ and that means go back one directory
2. root relative linking: begin the url with / and then use the full filepath
3. absolute linking: use a full url for the address, including the http:// and the domain name.