On Sun, Oct 31, 2010 at 3:00 PM, Nolan Darilek <[email protected]> wrote:

> It's not that I don't understand CSS selectors, I just don't understand
> why every single example I see insists on creating a div element beneath
> the body when the entire page is being styled. It seems especially
> unnecessary as it adds an extra level of nesting and indentation, and as
> someone who doesn't know a whole lot of CSS, I wondered if there was
> something wrong with just placing it on the body. I had looked at the
> CSS source and confirmed that it was allowed, but "allowed" and "best
> practice" are two completely separate beasts. :)

I don't understand why every response so far has done such a terrible
job of answering your question.

The reasons it's considered "best practice" to use a separate DIV for
"container":

1. Designers usually have to apply specific background styles to the
BODY, and then more background styles to the containers which are
centered within the BODY.
2. There can be other elements on the page that don't follow the
Blueprint grid and might be wider than 950px (like the header or
footer).
3. Usually the BODY is intended to be the width of the viewport (HTML,
BODY { width:100%; }). Changing the width of the BODY can lead to
unexpected behavior _especially_ with horizontal scrollbars.

Your mileage may vary, but I do not recommend applying class
"container" to the BODY element.

-- 
--
Christian Montoya
mappdev.com :: christianmontoya.net

-- 
You received this message because you are subscribed to the Google Groups 
"Blueprint CSS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/blueprintcss?hl=en.

Reply via email to