Styling the tribute page with CSS

Tell us what’s happening:
Describe your issue in detail here.
Hi, I am trying to change the background-color of the main element but it’s not changing it just remains white. my main element has an ID of main

Your code so far
Here’s my code:
background-color: blue;

Your browser information:

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

Challenge: Build a Tribute Page

Link to the challenge:

Hi radzi,

This isn’t enough information for us to help. do you have a link to all of the code eg on codepen

here is the link:

If you use , as it’s a tag, you don’t need to use the # to change the style.
. is for classes and # is to the element’s id.

Analizing your code is bad structured.
You should have a head element first and then a body with all your view inside.
Your code doesn’t work because you needn’t use tags in the css box or document.

oh okay, Thanks a lot

1 Like

Before the main element background color will change, you to input style tags above the <div id="main> : body{ background - color: green;
Color: white ;

Try this.

If that works mark the post as solved :wink:

Have a nice day.

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