Coding did what it was supposed to, still getting error

Tell us what’s happening:

I don’t understand what it is I am not doing. It is giving me “Your < style > should have a pink-text CSS that changes the color” what I have coded has changed the text pink, so what am I doing wrong? should the color be represented in numbers?

Your code so far


<style>
  body {
    background-color: black;
    font-family: monospace;
    color: green;
  }
  h1 {
    color: pink;
  }
</style>
<h1 class="pink-text">Hello World</h1>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/prioritize-one-style-over-another

The request:
"Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text."

Where is your pink-text class? that you have applied, correctly, to <h1 class="pink-text">

ok, I put in the h1 {
color: pink;
} then, I put in my

Hello World

and Hello world changed to pink, but it keeps giving me that my should have a class that changes the color.

not an h1 styled with color pink

The problem is in the above code. you need to change h1 to something else :slight_smile:

yes I wrote it here wrong, but I have

Hello World!

, and the text is pink, but it is still giving me an error message.

there you go:

<style>
  body {
    background-color: black;
    font-family: monospace;
    color: green;
  }
  .pink-text{
    color: pink;
  }
</style>
<h1 class="pink-text">Hello World!</h1>

In your css you’re linking to h1 directly (by writing h1{ color:pink} which works fine but the challenge want you to link to the .pink-text class so instead write .pink-text{color:pink}this has the advantage that you can assign the class to other things and they will also turn pink.

Oh, Thank You!!! I was putting # instead of the period.

thanks~It worked! :smiley: