Your <style> should have a pink-text CSS class with its color set to pink

Your should have a pink-text CSS class with its color set to pink.

1 Like

no. u should.

what did u try?

1 Like

Which challenge are you doing exactly? I think I know, but just want to be sure.

1 Like

I supose where you got stucked. Try to do this:

  1. Create a class in the CSS style sheet called pink-text.

  2. To set the color of the text, you may put the color property inside the class. Set pink as its value.

  3. Then add the pink-text to your HTML element (I don´t know which element it is, but it should be a <p> or <h1>, maybe a <div>)

Anyways, better copy your full code, it will be more easy to help you.

I have code like this

body {
background-color: black;
font-family: Monospace;
color: pink;
.pink-text:{color: pink;}

Hello World!

but it doesn't work.

Did you add the pink-text class to your paragraph element? The code you show above is correct, you defined the pink-text correctly in the style element. You still need to add it to the opening <p> element, you don’t show the code for your paragraph element, but I am pretty sure that’s what the problem is.

Try this:

<h1 class="pink-text">Hello World!</h1>

Look back at this exercise to refresh yourself on how to define and assign classes.

I have the exact same problem.
I dit exactly what you said PerryChalmers and it still doesn’t work :disappointed_relieved:

Ok guys I just find what was wrong : I just forgot the “;” in the class putting
.pink-text:{color;pink} instead of .pink-text{color:pink;} (with ; at the end)

Sorry for bothering guys thanks from France !


you shouldn’t have colon : before curly braces