Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS How to Make a Website CSS: Cascading Style Sheets Center the Wrapper

Orange Background

The background color will not change to orange inside of my wrapper.

5 Answers

The way you comment in CSS is using /* comments here */. You're actually using the method for commenting in HTML. Just change that up and it should work fine.

a {
  text-decoration: none; /* gets rid of underlines on links */
}

#wrapper {
  max-width: 940px; /* want the width to be no larger than 940px across */
  margin: 0 auto; /* sets margin or spacing around element */
  padding: 0 5%; /* spacing around words; 0 padding on top and bottom, 5% padding to left and right sides of element */
  background: orange; /* orange background */
}

a <!-- gets rid of underlines on links--> { text-decoration: none; }

wrapper

{ max-width: 940px; <!-- want the width to be no larger than 940px across--> margin: 0 auto; <!-- sets margin or spacing around element--> padding: 0 5%; <!--spacing around words; 0 padding on top and bottom, 5% padding to left and right sides of element--> background: orange; }

It's always helpful if you can post your code but below is what you should have.

a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 5%;
  background: orange;
}

I have that exact code and the background color still will not change:

a <!-- gets rid of underlines on links-->
{
  text-decoration: none;
}

#wrapper 
{
  max-width: 940px; <!-- want the width to be no larger than 940px across-->
  margin: 0 auto; <!-- sets margin or spacing around element-->
  padding: 0 5%; <!--spacing around words; 0 padding on top and bottom, 5% padding to left and right sides of element-->
  background: orange;
}

Hey Summer,

Post your code in the forum so we can see what's going on. In order to post your code all you need to do is put three back ticks before and after your code snippet. Like this:

h2 {
color: green;
font-size: 20px;
}

Hi Matt, I just posted it above!

thank you!!