...

View Full Version : What is a wrapper for?



vinoman
08-08-2007, 06:06 PM
I have seen wrapper divs but I still don't understand what they are for?

What is the purpose of a wrapper?

Jutlander
08-08-2007, 06:09 PM
It is the section you wrap everything in. Behind the wrapper is the body, so if you for example set a background color to the body, it will show, except in the #wrapper.

rmedek
08-08-2007, 07:49 PM
I have seen wrapper divs but I still don't understand what they are for?

What is the purpose of a wrapper?

Using a div as a wrapper (or #container, or #content, or #whatever) just adds one more style hook. It makes it easy to do things like center a fixed-width website, or define a solid width to fit columns in. I use "#wrapper" all the time, but like all style hooks it's up to you whether or not you need to use it.

VIPStephan
08-08-2007, 08:11 PM
Iíve always used a wrapping div because I thought the body wasnít as easy to style as a div. However, recently I noticed that a wrapper wouldnít be mandatory for regular websites as the body can be styled like a regular div in recent browsers (donít know about IE5/NS6). Iíve done this on this website (http://duncker-oerding.de) Iím currently developing. I used the html and body elements to apply background colors and images (still used a #container div due to many background images and general styling). I see a problem in Netscape 7, though, in that the html wonít take a background image.

vinoman
08-09-2007, 02:35 PM
It is the section you wrap everything in. Behind the wrapper is the body, so if you for example set a background color to the body, it will show, except in the #wrapper.

If everything is in the wrapper, how would you see any background color?

Jutlander
08-09-2007, 02:38 PM
Because it doesn't necessarily have to fill out all space. You could center a site with it or you could leave a 10 px margin on all sides, if that's what you want. Try it out and you'll see for yourself.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum