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

Mukund Narasimhan
PRO
Mukund Narasimhan
Pro 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
932 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
PRO
Bob McCarty
Pro Student 16,614 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%;
}
James Velardi
James Velardi
1,349 Points

Just add

body { width: 100%; }

thanks james , this worked!