Css selectors.id, class

hey guys I have a question please help.
the id is not gonna let me override the class. I am trying to change orange

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

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

Challenge: Override Class Declarations by Styling ID Attributes

Link to the challenge:

Screenshots do not help. In the future use the ‘Ask for Help’ button.


We cannot see if you have applied the id to the h1 element
You have not closed the #orange-text selector correctly
The body selector is no longer closed correctly

Hi @qaydiski !

Welcome to the forum!

It also looks like you haven’t closed the body selector correctly.
Right now, your #orange-text and .pink-text selectors are nested inside the body selector.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

the color is not going to change to orange .

   **Your code so far**


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

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

Challenge: Override Class Declarations by Styling ID Attributes

Link to the challenge:

thanks i will post correct question.

I moved your post over here since we don’t allow duplicated topics.
Thanks!

You accidentally removed the closing } on the body.

1 Like

thank you so much .I was missing that closing tag .

You do not have a closing on the body. Well, just based on my observation and basic HTML knowledge. Feel free to correct me if I am wrong. As far as I can remember, there is a colour palette you can refer to that has numbers. Look for orange’s number

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