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 trialVictor Mercier
14,667 PointsRoot relative and relative file path
Is someone able able to explain me the advantage of using root relative path to relative file path? Thanks in advance!
1 Answer
Manuel A. Martinez
10,919 PointsHi Victor;
I added a link that explains the differences between:
- Absolute File Paths
- Relative File Paths
- Root Relative Paths
Follow this link: Absolute File Paths VS. Relative File Paths VS. Root Relative Paths
Hope this answers your question.
Manny
Max Klopsch
22,628 PointsMax Klopsch
22,628 PointsSay your CSS file is at the root of the website: example.com/styles.css but you are on the following page example.com/contact. If you use the relative file path to the css href="styles.css" the browser won't be able to find the file because it will look at example.com/contact/styles.css In this case the root relative file path href="/styles.css" will let the browser know to look at the root of the website so at example.com/styles.css and be able to find the file.