Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,589 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
Samantha Atkinson
Front End Web Development Techdegree Student 34,914 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.