Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Mike Casteel
Mike Casteel
7,960 Points

Can not pass "Values and Units"

Been stuck for a few days now and just can't figure this out. Get to question 3 of 3 and SPLAT! Bummer message no matter what I try.

Library > Websites > CSS Foundations > Values and Units Code Challenge: Numeric and Textual Data Types

Question 1: Set the color of the 'strong' text back to its initial color value. Answer:

strong {
  color: initial;
}

Question 2: Add 'bg.jpg' located inside the img folder as a background image to the div with the class 'wrapper'. Answer:

.wrapper {
  content: url(img/bg.jpg);
}

On A Roll!!!! Question 3: Using a percentage, set the paragraph to half of its current width.

Easy right? My first try:

p {
  width: 50%;
}

After trying several other ways I admit, just not getting it! Please help pointing me in the right direction.

html I am working with:

<!DOCTYPE html>
<html>
<head>
  <title>Numeric and Textual</title>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="wrapper">
        <p>
            <strong>Some</strong> Crazy <a href="#">Text</a> 
        </p>
    </div>
</body>
</html> 

4 Answers

Chase Lee
Chase Lee
29,275 Points

Instead of content in:

.wrapper {
  content: url(img/bg.jpg);
}

Do background:

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

Also try putting quotes around your url like this:

.wrapper {
  background: url('img/bg.jpg');
}
Anthony Mayfield
Anthony Mayfield
6,053 Points

Peculiar. Yes, this also tripped me up. I think mostly because it said I had the right answer after part 2, which lead me to believe part 3 is the part I was entering incorrectly. May be something you guys want to take a peek at :)

Thanks!

Ho Sun Lee
Ho Sun Lee
2,003 Points

that's weird, I straight up put div {background-image: url('..img/bg.jpg');} and it worked fine.

Craig Charlton
Craig Charlton
8,124 Points

this is crazy.... without searching the forum (technically cheating but hey! I'm a problem solver)... 2nd challenge (insert url) passes without quotes but then part 3 fails because there are no quotes on part 2.... this is madness and people could be stuck for days as as usual the error message (bummer) is not relevant...