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
Jacob Jackson
UX Design Techdegree Student 7,799 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