Stuck on CSS color code

Hi, so I am stuck in CSS color code part where you can change the font to colors different colors like sea green etc using base 16. It’s asking me to do a very simple thing of adding the code in the css sheet and I have, but a message keeps popping up saying “Try again, did you make your h3 rose colored?”

h3 {
#cc6666;
}

h2 {
#8a2be2;
}

general css syntax:

selector {
  property: value;
}

your selector and value are good, but you forgot the property (border)

1 Like

Here’s another variation of code to color your text;

<h3>Message...</h3>
// This defines the message... (HTML Code)
h3 {
        color: red;
}
//This will color all h3's red. (CSS Code)

You may find this a bit in efficient however; here’s why… - this will color every h3 element red. If you wish to color only certain h3 elements you can wrap it in a div to organize and define your code better. Here’s how that would look;

<div class="nameofyourdiv">
    <h3>Message...</h3>
</div>

//This will create a header named "Message..." in the div "nameofyourdiv" (HTML Code)
.nameofyourdiv h3 {
    color: red;
}
// This will color all h3 elements in the defined div, red. (CSS Code)

This is much more specific code; and can be useful to you… But either way; it’s all up to you. :smile:

Hope it helped! c:

why that method, and not:

<h3 class="red">Message</h3>

and then in css:

h3.red { color: red; }

We are going off-topic now

Are you even supposed to be using CSS in this part of the course?

yes, whoever made this question didn’t include the right track (this is css an overview i believe)

I flagged for moving.

2 posts were split to a new topic: Need help with css color code