Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website CSS: Cascading Style Sheets Use ID Selectors

Trouble changing the background color with my main.css workspace page

When I try to change the background color of my webpage, when following along with Nick, my page does not change. I have checked my main.css and index.html files multiple times and cannot seem to find any errors.

6 Answers

Did you copy and pasted the code you gave? Because if you did, you spelled stylesheet as "sylesheet".

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

Can you post your css? Also, are you sure that the css is linked to your html page properly?

Joe Dayvie
Joe Dayvie
11,956 Points

css.main - Do you mean the main.css? Make sure the .css is at the end of the file you created/linked. Additionally, make sure your quotes are the same on both sides and that you included the rel="stylesheet" aspect.

this is my index.html code:

<!DOCTYPE html>
      <meta charset="uf-8">      
      <title>Daryl Stamps | Special Effects Makeup Artist</title>
      <link rel="sylesheet" href="css/normalize.css">
      <link rel="sylesheet" href="css/main.css"> 

below is my main.css code:

body {
  background-color: orange;
Joe Dayvie
Joe Dayvie
11,956 Points

Your meta tag is incorrect as it should be UTF-8. I know this may sound silly but I just wanted to ask - Is that your entire index.html code or do you have more? If not, then you need to actually have a body tag in your index page for the background to be applied to.

I do have a body, I was just posting the <head> section, because that is where i believe where he problem lies. Also, thanks for the UTF-8 heads up, that data was wrong on my end.

Joe Dayvie
Joe Dayvie
11,956 Points

Did you check to make sure the actual files are in the CSS folder?