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

CSS CSS Layout Basics Getting Started with CSS Layout Creating a Layout Wrapper

what if I use a body

If I use the body as a wrapper. The instructor is talking about we cannot have image as a background. I don't understand it. Can anyone explain me please

Hey Vamsi,

Can you please provide more background information? Which instructor? Which lesson?

Thanks

Devon Deason
Devon Deason
7,061 Points

If you were to use the body as the wrapper for you image, you would loose the ability to control the size of the image when viewed across devices with different screen sizes, the image would default to whatever the size of the user's screen is. Additionally, you would be unable to create space between your image and the edges of the view port, e.g. margins. By creating a wrapper inside the body, you are allowed many options for adjust of the image to whatever specifications you like.

1 Answer

Zolbayar Orshil
Zolbayar Orshil
9,838 Points

The default body tag takes up 100% height and width of the screen. Also some browsers don't support some properties like max-width etc on body tag i am talking about EI7 or earlier. So div wrapper let you center the content easily or whatever like borders since wide screen can stretch your content to its full width if use body as wrapper. In most cases, people just use #wrapper div or #container div just to be safe with some zooming with IE7 or earlier.
I am not sure it helps or not anyway good luck