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 trialRadha Bhambwani
10,182 Pointsbackground image CSS values
I'm having a really tough time with this code challenge. I'm trying to follow the instructions exactly but for some reason my values are not passing.
<!DOCTYPE html>
<html>
<head>
<title>Multiple Background Images</title>
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="sketch"></div>
</body>
</html>
/* Complete the challenge by writing CSS below */
.sketch {
background: url('img/smiley.png') no-repeat top right, url('img/pencil.png') no-repeat bottom left, url('img/texture.jpg') #EED293;
}
4 Answers
Ken Alger
Treehouse TeacherRadha;
- You need
pencil.png
prior tosimley.png
. - The positions are left/right first then top or bottom. I.e. not top right but right top.
Also, as a style point, it makes it a lot easier to read if you have line returns after your commas instead of a long single line, something like:
.foo {
background: url('img/bar.png'),
url('img/baz.png'),
url('img/qux.jpg') #EAEBEC;
}
Happy coding,
Ken
Jesse Fisher
10,830 PointsI had the same problem with this one.
Check the order of your background images.
Radha Bhambwani
10,182 Pointsi switched them all around. none of those worked.
Radha Bhambwani
10,182 PointsThanks Ken! That's what the problem was - #2. and I styled it the way you did and it looks a lot better. I thought of doing that earlier too but I wasn't sure if that format was okay to use! Thanks for your help though!