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
secilinam
1,273 Pointstrying to put background image but it doesn't work
body { background-image: url(images/coffeee.jpg); }
h1{ font-size: 120px;
}
.social-icon{ background-color: yellow; width: 50px; height: 45px; }
index.html <head> <meta charset="utf-8"> <title>Autumn 2016</title> <link rel="stylesheet" type="text/css" href="css/normalize.css"> <link rel="stylesheet" type="text/css" href="css/main.css"> </head> <body>
<header>
<a href="index.html"></a>
<h1>Deli Cafe</h1>
<nav> <ul> <li><a href="index.html">Home</a></li> <li><a href="aboutus.html">About Us</a></li> <li><a href="gallery.html">Gallery</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </header>
1 Answer
Cezary Burzykowski
18,291 PointsHey there :)
It would be much easier if you would put this code into workspace or if you would paste the whole code here as snippet :) Pasting a snippet is pretty fast you just start and end with three backtick characters: ``` So it would look like this:
your code
When it comes to image not working, do you have folder for your CSS file and your images? If you do then you code should look like this:
body {
background-image: url(../images/coffeee.jpg);
}
You need to use ".." before the path "/images/coffeeee.jpg" to go back to your main folder
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherHi there! This will be hard to troubleshoot unless we can see your file/directory structure. Are you doing this in workspaces? If so, could you please link a snapshot to the workspace?
One thing I'd point out though is this line:
body { background-image: url(images/coffeee.jpg); }Are you positive that the file name is "coffeee.jpg" with 3 e's instead of "coffee.jpg" with 2?