html - Using the body element as a page wrapper -


yesterday had discussion colleagues using body element wrapper avoid div.page-margins or div.wrapper direct first child of body element.

i use body page wrapper , apply sorts of styles width, margin, positions etc. on it. quick search found these 2 blog posts [1, 2] confirm me.

my colleagues don't idea because there once problems (ie7 + page zoom) , used use div.wrapper inside body.

so question is: there code specific arguments against using body element normal container element?

addendum: because defining best practices our frontend team want rid of habits- , using div.wrapper because used 1 of habbits :)

in addition background-color reasoning provided others, other case can think of necessary have wrapper these days enforce footer "stick" end of document (bottom of viewport when document short). aside these cases, can't think of reason why wrapper required. know i've used wrapper long can remember, chances colleagues me - it's old habit days when wrappers necessary avoid rendering bugs in aged browsers.

i still best practice have wrapper. way if spec requirements change later on require full-window background color or fixed footer, don't have add wrapper later , deal moving styles around lot. after all, you're talking 21 bytes...

<body><div id="body">...</div></body> 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -