Change the Color of Text..please I need help on this

Change the Color of Text..please I need help on this
0.0 0

#1

I have tried adding style to the h2 tag yet I keep getting this error message “Your style declaration should end with a ;” when I run test. please I need help on this.

below is my 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/67.0.3396.87 Safari/537.36.

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


#2

Your code looks fine.

I think you may have to refresh your browser ctrl + r and then click on ‘run test’ again.

I hope that helps.


#3

Thanks for the reply Diaolupo, I have refreshed my browser and have rerun the test but the same error message still comes up. is there any other alternative? Thanks


#4

Did you by chance copy/paste the style="color: red;" part into the h2 element code or did you type it out? If you copied and pasted it from somewhere else, it is possible you copied some hidden characters which are after the semi-colon and the tests are picking them up.

When I copy and paste your code and test it on my computer, it fails also. However, if I just type it out, it passes fine.


#5

Thanks you for the reply, I have typed the code, deleted and retyped it yet it keeps failing when I run test


#6

Can you post just the h2 element code here again? Make sure to put 3 backticks on the line before and line after the code you post.


#7

<h2 style="color: red;">catPhotoApp</h2>

Done


#8

If the above is your code, then it should pass. Try refreshing the page (F5 in chrome) and running the tests again.


#9

Despite the line looking like

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

“color: red;” in red in the query text,

it remains blue in the actual code, even if I erase it and reenter it completely.


#10

You must put 3 backticks on the line before and after your code (as I mentioned above), so that it looks like code on the forum.

EDIT: I put the 3 backticks in for you this time. I just noticed that @psm1 correctly put Cat instead of cat in the CatPhotoApp text. This code should pass as I copied the code and it did pass the tests. You may have to refresh the page again with this new code. Another option is click the Reset All Code and enter the correct solution again.


#11

Whew!
Thank you so much, this worked.


#12

@Uuujuuu Yeah, I missed the case issue of catPhotoApp vs. CatPhotoApp when you first posted your code.


#13

Despite the line looking like

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

“color: red;” in red in the query text,

it remains blue in the actual code, even if I erase it and reenter it completely.


#14

Finally catching up.

I will just try to reset every thing.