djutila / f1-3-c2p1-colmar-academy

0 stars 0 forks source link

Relative and Absolute paths #1

Open jim-rosales opened 6 years ago

jim-rosales commented 6 years ago

You should avoid using absolute paths such as file:///Users/danealdenjutila/Downloads/capstone_colmar_assets/images/ic-logo.svg when linking images to a project. The reason for this is because when you move your project onto another machine, your images won't work. For example, when I download your project and open it in a browser what is shown is a broken page as seen below:

screen shot 2018-01-18 at 12 41 03 pm

Instead of using an absolute path where you write out the full path (address) of where the image is located you should use relative paths. Relative paths indicate where an image is relative to the project.

Next time you should try and group all your files in a structure like shown below:

screen shot 2018-01-18 at 12 50 58 pm

This will allow you to be more organized and let you move your project freely onto different machines without having to change file paths.

If you use the file structure above you would access your images like this: <img src="resources/images/ic-logo.svg" alt="logo-icon">

https://github.com/djutila/f1-3-c2p1-colmar-academy/blob/5597689c4a3c76769349133c1ce063bf082d78b0/capstonefinal/index.html#L28

djutila commented 6 years ago

Awesome explanation, super helpful.