HTML Files and Folders

Absolute Paths:

Relative Paths:

  •  a file path to the file relative to the current page
    • <img src=”/images/picture.jpg” alt=”Mountain”>
    • <img src=”images/picture.jpg” alt=”Mountain”>
    • <img src=”../images/picture.jpg” alt=”Mountain’>

“../”

  • Each “../” essentially moves the file back one directory. “../../” would move you back two directories. It finds the root folder and the files in it. This is helpful when you aren’t sure where the relative path starts from.

(It is best to use Relative file paths when possible, web pages won’t be bound to the current base URL. All links work on your own computer, current public domain, and future public domains.)

These paths are important to web design and development because they allow you to have a nice and organized website and structure. Absolute and Relative paths are needed in separate circumstances, but they help you make the best webpage in the end.

Absolute-Path-VERSUS-Relative-Path.jpg

Difference Between Absolute and Relative Path

Leave a comment