Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The body element is already a wrapper. (camendesign.com)
5 points by westondeboer on May 10, 2011 | hide | past | favorite | 1 comment


Before anybody goes off and starts using this everywhere, you need to keep one thing in mind:

You want one wrapper to be the viewport size (at least) for modal dialogs and other UI bits.

By using the <body> tag as your wrapper, ~99% of web tips that use it for doing position offsets (absolute/fixed with top/bottom/etc) will now be totally skewed.

I used to do this all the time myself, but I'll be the first to admit it's not as flexible or "cool" as people think. If I'm working on a project where I won't need aspects like this I'll still do it from time to time, but it is not without its drawbacks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: