Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Build the Footer

What do relative links mean compared to absolute links?

I'm doing the exercises How to Make a Website and they're explaining the part to when and when not to use an absolute link or a relative link. I still don't quite get it.

2 Answers

Kevin VanConant
Kevin VanConant
1,833 Points

Relative links are linked to files in your file system. Use relative links whenever you can. If you link everything to outside links and say the other website goes down or they remove the file you were linked too, your link inside your website will break.

Relative is files you host in your file system Absolute you link to another website.

Absolute you use to link to other websites. If you are advertising and link to someone elses website you would absolute link to their website.

Hope this helps explain it a little more!

Happy Coding!

Relative links are links (usually internal to your domain) that are referenced realtive to the current file location.

<img src="images/picture.jpg">would look for a folder called images in the SAME folder that the current file is in and then lookin for picture.jpg in the images file.

<img src="../images/picture.jpg"> looks 'one folder level up' for the images folder.

Absolute links are full http links, usually to external sources.

<a href="http://www.facebook.com/yournamehere">