Css styling problem

Tell us what’s happening:
Describe your issue in detail here.
"Create a CSS class called pink-text that gives an element the color pink.

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

according to above instructions what wrong in my code.

  **Your code so far**

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

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36

Challenge: Prioritize One Style Over Another

Link to the challenge:

1 Like

You have to declare pink-text as a class inside your style tag.

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

Esse é o código certo, você não colocou o ponto no começo da ‘classe’ para identificação.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.