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
Lady Do While
6,027 Pointsurl() vs src=""
Why does background-image use url() instead of src="" like <img> does?
1 Answer
Timothy Madison
5,016 Pointsbackground-image uses url() because that is css code. Image tags in html (<img>) use src="" because that is the html code. They have similar purposes, but it's different code. You could no more use url() in html to access an image any more than you could use src="" in css to access an image.
Lady Do While
6,027 PointsLady Do While
6,027 PointsYeah I guess going through the material so quickly the languages start running together. Thanks!
Lady Do While
6,027 PointsLady Do While
6,027 PointsYeah I guess going through the material so quickly the languages start running together. Thanks!