Form needs to have an "ID"

Tell us what’s happening:
Hi there, i am a total beginner for CSS.
Just encountered some problems as i tried to solve this exercise. While i created an ID for the form, the result showed that “Your form element should have an id attribute.”

Can anyone help take a look? Thanks.

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;
}
#cat-photo-form {background-color:green;
}
</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="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>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36.

Challenge: Use an id Attribute to Style an Element

Link to the challenge:

I’m afraid there is a bug on this exercise. Make sure there is no double spaces on this line:

<form action="https://freecatphotoapp.com/submit-cat-photo" id="cat-photo-form">

In particular, try removing a space before id

Thank you!!
I was wondering how “space” works when doing HTML CCS stuff.

Space in html isn’t relevant. If you write:

<p>         hello     </p>

You’ll see:

<p> hello </p>
  • In short: one or more spaces count as one.
  • In css it’s exactly the same. Any number of spaces are counted as 1.
  • Of course this will cause troubles:
.my s el ect or{/*code*/}

Update: control whitespace from css!
You can control how whitespace is parsed with CSS.

white-space: [normal], pre

normal is the default value and collapses whitespace. pre preserves the white space. You can check this nice post for details.