Change the <h2> color to red

Tell us what’s happening:
I need to change the color of the

element to red, and i’ve been trying but maybe i add some code wrong and it doesn’t read …
I need help please

Your code so far

class= red-text {
   color: red;
<h2 class="red-text">Catphotoapp</h2>
<p>Click here to view more <a href="#">cat photos</a>.</p>

 <a href="#"><img src="" 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 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0.

Challenge: Use a CSS Class to Style an Element

Link to the challenge:

hint: if you want to style a par using

.toleft{ text-align:left; }
your html should be

<p class="toleft">

This challenge has two parts:

Part 1:

Inside your style element, change the h2 selector to .red-text and update the color’s value from blue to red .

You’ve got a small issue here.

thisIsTheSelector {
  // Body of class goes here;

The syntax highlighting is showing that something is wrong with your rule, and it’s your selector!

Part 2:

Give your h2 element the class attribute with a value of 'red-text' .

This one you got!

I get it…
Thanks so much!
I was struggling :grin:

1 Like