Asking for help about thw code

Asking for help about thw code
0

#1

Please. help me with this

<style>
  .red-text {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>

#2

What are you trying to do?


#3

What’s the issue you’re having? If you’re trying to change the color of the<h2> element, you have the right code.


#4

I tried this code several times. But it didn’t work eventhough it is corrected


#5

What is the name of the challenge? We need to know what the challenge is asking you to do, so we can check your code against the instructions.


#6

If this is the ‘Change the Color of Text’ challenge, your code seems to be correct. I would suggest possibly doing it differently than in between style tags. That may be why it’s not passing you.


#7

Is the following link the challenge?

https://www.freecodecamp.org/challenges/change-the-color-of-text


#8

Yes it is. That’s the challenge.


#9

Your code is using a class to style the color. The challenge wants you to use the style="" syntax, which is also known as inline-styling. You just need to move everything current between the { } in the h2 selector definition to be inside the “” of the style="".

The example did the same thing for the h2 element, but made the font color blue instead of red.

<h2 style="color: blue">CatPhotoApp</h2>