Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Basics Getting Started with CSS Layout Centering Page Content and Creating a Full-width Header

Mukund Narasimhan
PLUS
Mukund Narasimhan
Courses Plus Student 9,332 Points

https://w.trhou.se/c1ozfafvnq i am not getting full layout in header and footer can any 1 help me

https://w.trhou.se/c1ozfafvnq

i am not getting full layout in header and footer can any 1 help me out i have done as shown in this video

3 Answers

Gianmarco Mazzoran
Gianmarco Mazzoran
22,052 Points

Hi,

if you inspect the index.html with the inspector tool in Chrome you'll se that in the normalize.css file on the line 19 there is this declaration that doesn't allows the full width of the header and the footer.

This is the rule in your normalize.css on the line 19:

normalize.css
body {
  margin: 0 auto;
  width:70%; /* simply remove this property */
}

To make it works:

normalize.css
body {
  margin: 0 auto;
}
Gianmarco Mazzoran
Gianmarco Mazzoran
22,052 Points

Glad that I helped you! Happy coding! :smile:

George Fuller
George Fuller
1,267 Points

Thanks a lot, this fixed it for me... although I didn't even have a rule for body in my normalize.css so I just scrolled to the very bottom and added in:

body {
margin: 0 auto;
}

and it fixed it! :)

Bob McCarty
PLUS
Bob McCarty
Courses Plus Student 16,618 Points

Mukund,

Try adding "max-width: 100%; to each."

.main-header {
    background: #3acec2;
        padding:1em 0;
        max-width: 100%;
}

.main-footer {
        text-align:center;
    padding: 2em 0;
    background: #d9e4ea;
        max-width: 100%;
}

thanks james , this worked!