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 Centering Page Content and Creating a Full-width Header

In this video https://teamtreehouse.com/library/css-layout-basics/getting-started-with-css-layout/centering-page-content

at 4:36 instructor seems to add text-align to footer, but the everything in the page gets centered. I don't understand? Is there something I am missing? Here is my workspace https://teamtreehouse.com/workspaces/12167722

1 Answer

Codin - Codesmite
Codin - Codesmite
8,600 Points

Before doing text-align: center on the footer, Guil applys the class container around the content of the middle of the page and the header, at 4:00 just before applying text-align: center to the footer he changes the class wrapper to be named container in the css file.

So Guil is also applying width 70% margin: 0 auto to the contents of the rest of the page which causes everything else to center to when he refreshes the page.

Can you check out the link for the workspace I have mentioned in my question and tell me why my footer and header does not occupy the entire width?

Codin - Codesmite
Codin - Codesmite
8,600 Points

The link returns "Page not found"

Tobias Edwards
Tobias Edwards
14,458 Points

It baffled me at first too, thanks for the clarity :)