Tuesday, May 10, 2011

body, div height 100%

body, div height 100%?

This question has a very simple answer, here goes the code –

<style type="text/css">

html, body {
height: 100%;
}

</style>

You must define ‘html’ element along with body and write ‘height: 100%’ property in it. Once you have this, “doctype version” doesn’t matter, it works just fine.

Bonus - A complete & descriptive list of HTML5 elements

Enjoy!!

No comments:

Post a Comment