Are you prepared for Wrath of the Lich King? WoW Insider has you covered!

Styling the html element

In his article "HTML's a Tag Too," Bryan Veloso discusses the benefits of applying styles to the <html> element. He argues that by making more effective use of <html>, developers could eliminate the need for a wrapper div. Everything would effectively be "moved up" a level - apply global styles to <html> instead of <body>, and then <body> can serve the same purpose as the wrapper div would have. Bryan points out that this can be particularly handy in XHTML 1.1, in which the <body> no longer stretches the entire length of the page.

It's a neat idea, but for many developers - particularly those of us who work on large, enterprise-level sites - it is simply impractical. On large sites, rarely would you want to declare a global background image, for example. Or, you may not be able to access certain elements of a page at all, due to CMS limitations or other restrictions. However, for a small-scale site, styling <html> could be a good way to reduce divitis, as long as you're mindful of scalability issues.

Reader Comments

(Page 1)

RESOURCES

RSS NEWSFEEDS

Powered by Blogsmith

Other Weblogs Inc. Network blogs you might be interested in: