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

HTML HTML Basics Structuring Your Content Grouping Content with <main> and <div>

Isn't a wrapper div a little redundant, you already have the body tag for that.

see title.

alvin wong
alvin wong
12,066 Points

The body tag hold most of the content of the site it just a way to see where the site contents start and having multiple body tag is confusing.

2 Answers

Shahetul Chisty
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Shahetul Chisty
Front End Web Development Techdegree Graduate 21,590 Points

I’ve found a wrapper useful when I want to target everything except for the nav. Such as creating space on each side of the content, but having the nav stretched across.

Samantha Atkinson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Samantha Atkinson
Front End Web Development Techdegree Graduate 40,307 Points

The cool thing about wrappers is that you can give your body selector a background that will cover the entire browser, no matter the size. Then with the wrapper, you could have a totally different background, like an image going on for your content and nicely center your content in the center of a browser no matter the width of the browser/viewport. A wrapper doesn't have to just wrap all content, it can be a wrapper for certain elements too.