What are the advantages of using relative paths?


#1

What are the advantages of using relative paths?
Aren’t absolute paths more secure? For example if I would move my internal html file accidentally into another folder, the relative path would be incorrect and thus the link dead.
Or would the internal moving change the absolute path as well; so that the absolute path relies 100% on the relative path?


FAQ: Learn HTML Elements - Common HTML Elements - Linking to Relative Page
FAQ: Learn HTML Elements - Common HTML Elements - Linking to Relative Page
#2

examples of absolute path:

# windows
c:\users\username\pictures\img1.jpg
# *nix
/home/username/pictures/img1.jpg

if then then move the image from pictures to documents, the absolute path would also break.

relative paths are better, given we can then move the entire project to a different computer (which very likely has a different username) and we don’t have to go and find all the absolute paths with the username in it