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 trialBei Zhang
Courses Plus Student 7,113 Pointsi checked the vertical elements, there is no larger part can collapse. could you kindly help me to check?
/* ================================= Base Element Styles ==================================== */
body { line-height: 1.6; color: #3a3a3a; }
a { color: #fff; text-decoration: none; }
/* ================================= Base Layout Styles ==================================== */
/* ---- Layout Containers ---- */
.main-header { background: #3acec2; padding:2em 0; }
.wrapper{ width:70%; margin:0 auto; }
.main-footer { padding: 2em 0; background: #d9e4ea; }
/* ---- Page Elements ---- */
/* ================================= navigation Styles ==================================== */ .name{ margin:0; }
Bei Zhang
Courses Plus Student 7,113 Pointsi have got it right. the default <body>element has a margin that keep space in the browser. thx for your attention
1 Answer
Steven Parker
231,275 PointsDocument body
styling usually has margins by default.
That usually results in a better appearance, but if you need to remove them you can do so in your CSS:
body { margin: 0; }
Amrit Pandey
17,595 Pointsthat is good to include but professional approach involves including a normalize.css file which removes all in-browser consistency.
Steven Parker
231,275 PointsA normalizing file would probably not remove body margins, but it might set them to a consistent value. You'd still want to remove them in your custom CSS.
Amrit Pandey
17,595 PointsAmrit Pandey
17,595 Pointscannot actually understand your problem. If you want to see margin collapse, put a red border around every element by
You'll see that some of the elements will flow out of the divs