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

CSS CSS Foundations Values and Units Numeric and Textual Data Types

on3iro
on3iro
12,644 Points

What am i doing wrong?

Hey,

i got stuck with this task, because i am always getting an error. But i can't seem to find out what mistake i made. Here's my code:

/* Write your CSS below */
.wrapper {
    content: url("img/bg.jpg");
}

strong {
    color: initial;
}

p {
    width: 50%;
}

The task says the following: "Using a percentage, set the paragraph to half of its current width."

I think that this is exactly what i did, but somehow it still says i am wrong.

Thx in advance for any help.

5 Answers

Hello, I'm thinking you should be using the background-image element to set the background.

.wrapper {
  background-image: url('bg.jpg');
}
Rivka Stein
Rivka Stein
2,541 Points

I just completed the same challenge and I got it right. Your problem is that you used "content" instead of background color. See above answer.

Craig Bauer
Craig Bauer
3,376 Points

This works too. If you want to also have a background color than use background-image & background-color.

.wrapper { background: url (bg.jpg); }

Craig Bauer
Craig Bauer
3,376 Points

This works too. If you want to also have a background color than use background-image & background-color.

.wrapper {
background: url (bg.jpg);
}
on3iro
on3iro
12,644 Points

Thank you both, that has indeed been my mistake. No everything is working fine :)