A bug ? Or a real problem in my code?

Challenge :
" Your div element should have the class silver-background .
Passed
Your div element should have a silver background.
Passed
A class named silver-background should be defined within the style element and the value of silver should be assigned to the background-color property."
NOPE

<style>
  .silver-background {
    background-color : silver;
}
</style>

 <div class="silver-background">
</div>

Everything is working, I have a background in silver color on the whole of my div.
On the video it’s the same thing.
I checked my code 5 times.

This does not validate. Why?

Try change to another browser.

Already tried, this does not solve the problem.

Can you post the link of the challenge here?

Is this your final code or are we missing anything here.
Because according to what we have here, this is happening because you don’t have any element inside your div tag.
add an h1 or p or something like that

I copied your CSS code, and I passed in Firefox.

I did not specifically touch the initial code.
Here is my full code. (I haven’t touched anything since a while ago)

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>

  .silver-background {
    background-color : silver;
  }
  
  .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;
  }

  
</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://bit.ly/fcc-relaxing-cat" 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="/submit-cat-photo">
    <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>

kapilguptacr7
Adding does nothing.

smile1120
Check my full code. I only sent what was necessary at the start.

I see. This is a syntax error.圖片
Try delete the space between the colon and “background-color”, and maybe you will pass.

4 Likes

CSS syntax for properties is

attribute: value

not

attribute : value

v small difference, but the tests will fail as second one can’t be parsed properly

1 Like

Thank you, I have this annoying tendency to leave spaces in my css that I did not necessarily pay attention to instantly.

Everything is functional! That was it !

2 Likes