I think this may be broken, or I am missing something

I sort of feel like something is broken here, as I’ve tried to directly copy and paste the help in but it didn’t work, anyone have any ideas?


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

<h2 class="red-text">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

Link to the challenge:
https://www.freecodecamp.org/challenges/use-a-css-class-to-style-an-element

Hi JamesT,

Your code achieves the required result, but does not do it in a way required by freeCodeCamp. See these 2 paragraphs:

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’.

Thank you for replying, I have now updated it, but it still insissts that my stylesheet should declare a red-text class. How does one set up a red text class if you cant do nests in css?

Strike my earlier answer. Can you paste your current code?

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

<h2 class="red-text">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

You need to define the .red-text class in the “style” section like so:

.red-text {
    color: red;
  }

Thank you for your help :slight_smile: