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 trialMichael Andreuzza
11,000 Pointsimg-path
why do we need a variable for img path....isn't it sort of more work?
1 Answer
Sam Gord
14,084 Pointsif you change the location of the image and if u used that address in for example 5 places, all u need to do in order to put everything in the correct place is to just change the address in that one address variable u defined and it will work perfectly, but if u type the address u have to change/correct the address 5 times ( or more ! ).
but, tbh, i haven't seen using css variables for holding image addresses, but i did see the benefits of storing color hex codes in css variables ;)
Michael Andreuzza
11,000 PointsMichael Andreuzza
11,000 PointsWell, with that point of view is fair-play. I agree, its much easier with variables for color,absolutely.
thank you for your answer.
/Mike