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
Sawyer Withers
1,251 PointsBackground image not working?
I am clearly making some kind of mistake but can't figure it out. I tried setting it to background-image and still nothing. I've done tons of background-images but this one won't work for me.
body { font-family: 'Ek Mukta', sans-serif; background: url('img/tweed.png'); }
Could I be missing something in my HTML? Thanks as lot, guys!
2 Answers
Mitchell Goldberg
3,322 PointsWhat exact isn't working for you and does your computer have EK-Mukta on it?
Vince Brown
16,249 PointsHey Sawyer,
are you using an external stylesheet for your css? and if so is it located in its own folder.
most of time when you get no image showing through it has to do with file paths, so if you are using an external stylesheet in its own folder you would have to traverse up the file structure for example
body{
font-family: 'Ek Mukta', sans-serif;
background-image: url("../img/tweed.png");
}
the leading two dots of url(../img/tweed.png); will take you up one directory to your root then enter the img folder and look for the tweed.png
hope this might help!
Sawyer Withers
1,251 PointsNever even thought of that. Thanks very much!