The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Using html and body instead of container divs

  • # May 24, 2013 at 4:02 pm

    I’m working on a WordPress theme, and when it comes to browser compatibility, I’m only interested in IE9 and up (maybe with some polyfills for IE8)

    This is what I’m using right now, and it seems to work in all the browsers I’ve tested it in:

    html {
    background: #eee;
    min-width: 320px;
    padding: 0 20px;

    body {
    position: relative;
    font-size: 100%;
    font-family: ‘Noto Sans’, sans-serif;
    line-height: 1.4;
    color: #444;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    background: #fff;

    Are there any drawbacks to this that I’m not seeing?

    # May 25, 2013 at 7:45 am

    Sounds perfectly legit.

    # May 25, 2013 at 7:53 am

    This reply has been reported for inappropriate content.


    IE6 use to make the difference in standard mode.

    Today, with a valid doctype, you can safely use html & body as regular containers to style.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed