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 trialScott Delman
5,436 PointsWhy is the footer centered?
Hello,
I can't help but notice that the footer is also centered after adding "margin: auto" to the primary-content and secondary-content class rule.
How does the footer get affected if the footer is in a class all of its own?
Is it because it has this code? .primary-content, .main-header, .main-footer { text-align: center;
Although, wouldn't it still be pushed to the side of the web page?
2 Answers
Matthew Stanley
1,071 PointsIt was already centered before. The element takes up the entire width of the page. When the text is centered, it's also centered on the page, since the footer spans the page. Change the background color, and you'll notice the width of the footer element.
Nick Yoho
6,957 PointsIs your footer wrapped inside another tag in your html?
Corinne Stockbridge
30 PointsCorinne Stockbridge
30 PointsTry taking .main-footer out of that line of code and on a line by itself, if you don't want it centered.