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
Michael Bredthauer
13,429 PointsFixing the position of a header/footer
When fixing the position of my header/footer to the top or bottom of the html I have a problem with the width and centering. I set a media query for max-width: 1000px, than margin:0 auto; and when I size the browser over that it doesn't stay centered, it will often stay to one side.
2 Answers
Luis Vazquez
6,370 PointsYou have 2 options:
Change your media queries to have a min-widths instead of a max-widths. In other words code your media queries to scale up (always declaring min-widths) instead of down (declaring max-widths).
Create another media query with min-width: 1000px and add the same css code to center elements.
The 1st option is the best long-term solution. The 2nd option is just a quick-fix.
Michael Bredthauer
13,429 PointsThanks ill give that a shot!
Michael Bredthauer
13,429 PointsMichael Bredthauer
13,429 Pointsthanks ill give that a shot!