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

Mukund Narasimhan
PLUS
Mukund Narasimhan
Courses Plus Student 9,441 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,076 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,076 Points

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

George Fuller
George Fuller
1,507 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!