CSS CSS Layout Basics Getting Started with CSS Layout Why Vertical Margins Collapse

Sage Savage
Sage Savage
Front End Web Development Techdegree Student 3,960 Points

Header and Footer collapsing?

I am working on my responsive design project and I want to get rid of the space around the top and sides of the header and footer. I tried what the video suggests but it didn't seem to work. Hoping some one could point me in the right direction. Thanks! Here's the link to my workspace - https://teamtreehouse.com/workspaces/25246662#

Edward Rosario
Edward Rosario
534 Points

Have you tried body { margin:0; }

Edward Rosario
Edward Rosario
534 Points

or try removing the padding/margins from the body tag.

body{ padding:0px; margin:0px; }

2 Answers

Sage Savage
Sage Savage
Front End Web Development Techdegree Student 3,960 Points

Thanks for your response, I tried that and it fixed the white space on the sides but not the top.

Francisco Osegueda
Francisco Osegueda
11,114 Points

The default margin and/or padding of the <h1>, <p> or <ul> elements might need to be remove.