Relative Pathing Basics: Understanding how to use relative paths is crucial for navigating files and directories in web development. A relative path refers to a location that is relative to the current directory or file, rather than a fixed (absolute) location.
File path problems are typical for students in assignments 1 & 3. Learning how to path images (or any files) early in the bootcamp will save you headaches down the road. It’s extra credit on A0(Git) but really should be completed successfully.
The example from this assignment should look like: /images/complete.jpg
Key Points to Remember:
Use ./ to refer to the current directory: It’s optional in many cases, but explicitly indicates the current directory.
Use ../ to move up one directory level: This is helpful for linking to files in parent or sibling directories.
No leading slash (/) in relative paths: Leading slashes refer to the root directory, not relative paths.