I set the h2 element to blue, but i'm still having errors

Tell us what’s happening:

Your code so far

<h2 {color: blue;}>CatPhotoApp</h2>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
    <p>Things cats love:</p>
      <li>cat nip</li>
      <li>laser pointers</li>
    <p>Top 3 things cats hate:</p>
      <li>flea treatment</li>
      <li>other cats</li>
  <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>

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 10323.67.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.209 Safari/537.36.

Link to the challenge:

You can specify the css of an element in two ways.

  1. inline-css: The style should be inside the element like the following:

<h2 style="color: red">CatPhotoApp</h2>


  1. Creating <style></style> and adding your css inside it (& also delete inline css):

If you want to add color red to the element first select it!

How to select it?

Look at the beginning of the tag and you’ll notice its name h2; write it between <style></style> and then open curly braces {} right after it just like in the following example:

      h2 {}

Until now, nothing will happen. I should specify the color which should be red by writing: color: red to make all h2 elements red like the following:

     h2 {
           color: red;

The result: all headings of type h2 will become red.

The exercise want you to use the second method of <style></style> to turn all h2 into blue.

I hope this was helpful and good luck.

1 Like