# Using wrapper div vs styling the html element

**URL:** <https://forum.kirupa.com/t/using-wrapper-div-vs-styling-the-html-element/327088>\
**Category:** web dev\
**Created:** [February 5, 2012, 4:05am UTC](https://forum.kirupa.com/t/using-wrapper-div-vs-styling-the-html-element/327088 "2012-02-05T04:05:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashgroove](https://avatars.discourse-cdn.com/v4/letter/f/b5e925/32.png) [@flashgroove](https://forum.kirupa.com/u/flashgroove)\
**Post date:** [February 5, 2012, 4:05am UTC](https://forum.kirupa.com/t/using-wrapper-div-vs-styling-the-html-element/327088/1 "2012-02-05T04:05:48Z")

</div>

I have a question regarding what is a better practice when it is needed to have the site a specific width, like 900px.

Is it better to use a wrapper div tag, make the wrapper 900px and style the body tag or make the body 900px and style the html element ?

```auto

<html>
<body>
    <div id="wrapper">
        [content]
    </div>
</body>
</html>

body {
    background-color: #202020;
}
#wrapper {
    width: 900px;
}

```

```auto

<html>
<body>
    [content]
</body>
</html>

html {
    background-color: #202020;
}
body {
    width: 900px;
}

```

Is it a good idea to apply styles to the html element ? If yes, then why has the wrapper div practice became so popular when there is this easy alternative ?
