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 Basics (2014) Basic Layout Styling the "Wildlife" div with Background Properties

Any ideas on the property and value this challenge is looking for?

I tried to rewatch the video but cannot find the CSS property they are looking for.

style.css
/* Complete the challenge by writing CSS below */
.wildlife {
  background-image: url('img/bear.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lake Tahoe</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
  </head>
  <body> 
        <div class="primary-content t-border">
            <p class="intro">
                Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
            </p>
            <a class="callout" href="#more">Find out more</a>
      <div class="wildlife">
        <h2>Check out all the Wildlife</h2>
        <p>
          As spawning season approaches, the fish acquire a humpback and protuberant jaw. After spawning, they die and their carcasses provide a feast for gatherings of <a href="#mink">mink</a>, <a href="#bears">bears</a>, and <a href="#eagles">bald eagles</a>.
        </p>
      </div><!-- End .wildlife -->
            <a class="callout" href="#wildlife">See the Wildlife</a>
        </div><!-- End .primary-content -->
  </body>
</html>
Peter Smith
Peter Smith
12,347 Points

Hey,

The final property is --- and the final value is ---.

  ----

so your final answer looks like :

.wildlife {
  background-image: url('img/bear.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  ----
}

(I haven't a clue why the Markdown doesn't properly color box-sizing, however that IS the proper syntax)

3 Answers

Alex Heil
Alex Heil
53,547 Points

hello Cernan Bernardo , depending on your code I guess you're looking for the anwser on task5 (the last task). so:

usually padding and borders are added to the element itself. so say you want an element to have a width of 200px and you then add 10px padding the element would be 220px wide (200px element + 10px left padding + 10px right padding).

good for us we can change the box-model to something called border-box - with this in place the 10px padding from my example would be calculated automatically, means the width we define for an element doesn't change - when we say it's 200px it really is 200px.

that said let's apply this to the challenge, like so:

.widlife {
 -----
}

with that one line added to your code everything will be fine. hope that helps and have a nice day ;)

Brenna Leker
Brenna Leker
7,596 Points

Hi Cernan, I believe you are looking for the box-sizing property. Check out this article from W3Schools.

Happy coding! Brenna

Thank you all! Makes so much sense now!

Hi Cernan,

If you feel any particular answer above was the "Best Answer" in helping you solve the problem we encourage you to select it as the Best Answer, the member who posted will be rewarded with some points and other members who may be facing the same challenge will know that they can find an answer within this post as they browse the forum.