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 CSS Layout Basics Getting Started with CSS Layout Layout Wrapper Challenge

Set the wrapper's width to 80% of the browser width. Then use margins to center the wrapper in the browser.

How Can I resolve this task?

Thanks in advance.

1 Answer

Michael Afanasiev
PLUS
Michael Afanasiev
Courses Plus Student 15,596 Points

Hello Luca,

Well since I don't know what are you coding, I can't point out your mistakes, but here is the CSS to pass this challenge:

.container {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

PLEASE REVIEW YOUR CODE AND DON'T JUST COPY/PASTE, THANK YOU :)

Jesus Mendoza
Jesus Mendoza
23,288 Points

you can also use margin: auto or margin: 0 auto; to shorten your code

Jesus Mendoza
Jesus Mendoza
23,288 Points

you can also use margin: auto or margin: 0 auto; to shorten your code