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 trialAngel Vickery
3,585 Pointsmy images will not pop up.
what am i doing wrong. i copied their code to the t and i still can not figure out why my pdf, jpeg, and .zip file images are not showing up.
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! While Kevin Korte is correct and you should definitely check out your file structure, I would also point out that in
every case where you have href
in the code you posted above, you also have an extraneous space before the file extension. This could be causing problems. For instance you posted:
a[href$=" .pdf"]
Try changing it to:
a[href$=".pdf"]
I believe it might believe that the file should contain a space before the extension otherwise. Let me know if this helps!
Angel Vickery
3,585 PointsJennifer Nordell, Thank you so much! all that was wrong was spacing.
Jennifer Nordell
Treehouse TeacherAngel Vickery The "devil is in the details" applies very well to coding
Kevin Korte
28,149 PointsHey Angel,
The most common problem is the file path to the image isn't correct, it happens to everyone. Make sure your files are where you're telling the computer they are.
What you're file path is saying, is from wherever this file is, go up one folder ( that's the ../ ), and then look for an img folder, then in there, look for these files.
Which means you must have a folder structure similar to
- --css
- ----style.css
- --img
- ----icn-pdf.svg
- ----icn-picture.svg
- ----icn-zip.svg
Angel Vickery
3,585 PointsAngel Vickery
3,585 Points*** This is my code***
/* Substring Matching Attribute Selectors ---- */
a[href^="http:"] { color: #52bab3; text-decoration: none; background-repeat: no-repeat; background-size: 18px 18px; padding-left: 25px; }
a[href$=" .pdf"] { background-image: url('../img/icn-pdf.svg'); }
a [href$=" .jpg"] { background-image: url('../img/icn-picture.svg'); }
a [href$=" .zip"] { background-image: url('../img/icn-zip.svg'); }