Inside your style element, change the h2 selector to .red-text and update the color's value from blue to red. Give your h2 element the class attribute with a value of 'red-text'

Tell us what’s happening:

Your code so far


<style>
h2 {
  color: blue;
}
</style>

<h2>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/81.0.4044.138 Safari/537.36.

Challenge: Use a CSS Class to Style an Element

Link to the challenge:

What have you tried so far? This looks like the starter code.

i’m learning basic starter code

What is your question then?

Your h2 element should have the class red-text .?

Ok, what have you tried? It looks like you haven’t changed anything about the code.

Ok, you are partway there. The instructions say

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

Do you see what else you need to do near where you changed the color?

now im really stuck

You haven’t changed the h2 selector to .red-text yet.

<style>
  thisIsTheSelector {
    color: red;
  }
</style>

damn thanks man i see it now

1 Like

I knew you could get there. Sometimes it just takes help to translate the directions.