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 Style the Basic Elements

Select the ID wrapper, set it to a max width of 940 pixels, and then center it on the page using the margin property.

a{
  text-decoration: none;
}
wrapper{
  max-width: 940px;
  margin: center;
}

Note: I thought I had the right idea??? Lesson challenge said, ID "wrapper" not sure about this either. I feel dumb to ask for help again but, I'm afraid I haven't enough experience with code to do otherwise.

2 Answers

Stone Preston
Stone Preston
42,016 Points

you select ids using # followed by the name of the id. for instance if I had an id called "someId" I could select it like so:

#someId {

}

also, margin:center wont work. you are going to have to use the auto value for margin like so

margin: 0 auto;

the first value, 0, specifies the top and bottom margin, while the auto value tells the browser to make it so that the left and right margin are equal on both sides, centering it horizontally.

thx great explanation. this site is awesome appreciate the help god bless.

If it's an ID called wrapper you need a # before the name of you ID in your css:

#wrapper {margin: 0 auto;}

then the margin needs to be auto on the right and left side.