Change the Color of Text Not Working

It says my h2 element should be red. I checked the video provided and followed it. Is it not red in my current code? Any help would be appreciated, thanks.

Your code so far



<h2 style="color: red;">CatPhotoApp</h2>
<main>
  <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>
  
  <div>
    <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>

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/change-the-color-of-text/

just remove </style> from your code

Hi @xei123, welcome to the forum.
To style a component in CSS you have 3 ways:

  • You provide a style attribute to the element
  • You provide some CSS code between an opening and a closing tag of the style element. This has to be put in the head element of your html document.
  • You provide a link to the CSS file inside the head of the document.

At the moment you are doing a mix of the first 2 ways.

I did. It still isn’t working for me.

I removed the style attribute but it still is not working for me.

check this link, I think you might found a solution

Issue was an addon I have on Chrome. I turned it off and it worked. Thanks!