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
Joel David Crouse
9,062 PointsCompass img subdirectories using image-url?
I noticed when using the image-url helper in compass that it seems to only access images if they are within the root img folder. How would I access an image using this helper within a subdirectory of the img folder?
Thanks, hope you understood my question
1 Answer
Erik Nemesis
13,356 PointsUse relative paths to the images root folder, so if you have a directory inside it, use it like that:
@include image-url('subdir/my_image.png').
Also if you want images outside of the root directory, you need to go up to the parent(s), like such:
@include image-url('../../../images/image.png')