Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Going Further with HTML Working on a Website Project Locally

Diana Haimov
Diana Haimov
824 Points

Hello, I still didn't understand how my local browser indicates this: "../../index.html" as a full local root.

a full local root as i know it is like this D:\DIANA\project\index.html so how come ../.. indicates as a full root Also, how would I know if I need only one ../ or more?

1 Answer

Jacob Jackson
seal-mask
.a{fill-rule:evenodd;}techdegree
Jacob Jackson
UX Design Techdegree Student 7,833 Points

Hey Diana!

Good question.

What you're referring to is not a full root path.

../../file_you're_linking_to.html

This is a relative path which is the safest to use in most cases because it only needs to know the file you're coming from and the file you're going to.

../

This is how you go up a level in your directory. You use as many of these as you need to get to the level you're looking for.

For example, let's pretend your directory looks like the following

css_folder
    + main.css
images_folder
    + image1
    + image2
index.html
inner_pages_folder
    + about_us.html

Let's pretend you're working on your "About Us" page and you're trying to add an image from "images_folder"

Well we know that about_us.html is in a folder called "inner_pages_folder", which sits at the same directory level as the images folder I need to get too.

So if I want "image1" I would do the following:

../images_folder/image1

This takes me OUT of the folder I'm in, takes me INTO the images folder, and selects the images I want.

Here's a nice article on the subject. https://www.w3schools.com/Html/html_filepaths.asp

I hope this helps!

Best of luck! -Jake