Module 8: Developer Workstation Basics

Lesson 5 of 5 · 15–25 minutes

File paths, absolute and relative

🏠The everyday picture

Two ways to give directions. Absolute: "Flat 4B, Green Towers, Boring Road, Patna". It works from anywhere. Relative: "two doors down from here". It only works if you know where "here" is.

📘What it really is

🖱️Try it

In your my-first-site folder, make a folder called images. From the terminal in my-first-site, run ls images and then ls ../. Notice what each shows.

✅Quick check

*Your web page shows an image using C:\Users\Asha\Pictures\logo.png. It works on your laptop but not on the

Show the answer

server. Why?* That absolute path only exists on your laptop. Put the image in the project (for example images/logo.png) and use a relative path.

You're in Projects/my-first-site. What does ../ point to?

Show the answer

The Projects folder, one level up.

← PreviousVS Code, your editor
ProLearners Assist