+ 1
what is the difference between the absolute and relative links?
2 Answers
+ 7
⢠Absolute links/paths are STATIC (thus usually long) and ALWAYS include the base domain name of the website. You must always use them when linking to a location from another website, but you can also use them within your own.
http://www.mysite.com
http://www.mysite.com/images
http://www.mysite.com/folder/list.txt
http://www.externalsite.com
⢠Relative paths merely POINT to another file/path within YOUR website. These are RECOMMENDED as they remain valid in case you need to change your domain in the future.
list.txt (1)
images/graph.jpg (2)
../folders/files/solo.txt (3)
These link to:
(1) a .txt file in the SAME directory
(2) an image inside the images folder in the SAME directory
(3) a .txt file located in folders/files in the PARENT directory (notated by ../)
They are all relative to their HTML document's location.
+ 3
Relative link is built like "current/path/of/file/" + "your/link"
1st part is path to folder where your html file is stored
2nd part is your link
Abdolute link contains both parts