Can't complete "Give a Background Color to a div Element"

Tell us what’s happening:

Hello,

I have problem, I’m stuck in very simple CSS exercise. I can’t see where I have done anything incorrectly, I think it might be bugged.

I have done as the exercise says to create a class called silver-background and give the property background-color the value silver.

**Your code so far**
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, monospace;
  }

  p {
    font-size: 16px;
    font-family: monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }

  .silver-background {
    background-color: silver;
  }

</style>

<h2 class="red-text">CatPhotoApp</h2>
<main>
  <p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

  <a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>

  <div class="silver-background">
    <p>Things cats love:</p>
    <ul>
      <li>cat nip</li>
      <li>laser pointers</li>
      <li>lasagna</li>
    </ul>
    <p>Top 3 things cats hate:</p>
    <ol>
      <li>flea treatment</li>
      <li>thunder</li>
      <li>other cats</li>
    </ol>
  </div>

  <form action="https://freecatphotoapp.com/submit-cat-photo" id="cat-photo-form">
    <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <label><input type="checkbox" name="personality" checked> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Energetic</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

As you can see I have assigned the class to the div element and the background is silver, but the test of having the background silver failed.

 **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0

Link to the challenge:

Can I see your code pls so I can know where you got it wrong !!!
From what I can see here, your code is correct reset the lesson & input the code again it should work...
1 Like

Hi.

I have tried reseting the lesson before, but I tried again and It still doesn’t work.

I didn’t mention this but I do have adblocker, https everywhere and dark mode extensions but i have them turned off for freeCodeCamp.

When you did that, have you passed the challenge now ???
1 Like

Ok this is so random, i tried turning off https everywhere but still didn’t work, i didn’t pass the challenge.

After 5 mins I tried again, and now it worked and I passed. I still don’t know what the problem was. I don’t think it was https everywhere, since i don’t know how that would interfere with the tests.

But anyways, thank your for help. Problem solved, I guess.

I’m glad you finally passed the test.Sometimes freecodecamp is crazy lol...Sometimes their website doesn’t respond to our test challenge even if we got it right just because we have stayed too long trying to get the tests correctly...
1 Like

Haha ok good to know. It is what it is.

Thank you for your help and quick responses.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.