Created
February 4, 2011 11:37
-
-
Save benhodgson/811017 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<style> | |
html { | |
height: 100%; | |
} | |
body{ | |
height: 100%; | |
} | |
.myDiv { | |
height: 100%; | |
background-color: red; | |
} | |
</style> | |
<body> | |
<div class="myDiv"></div> | |
</body> |
I laugh in the face of validation.
well if we are going for omitting as much as possible this might work better:
<!doctype html>
<style>
html,body,div { height:100%; }
div { background:red; }
</style>
<div></div>
Yer I can optimise. Check me out.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You totally want to add a
margin: 0;
to the body element. That would make this an awesome full page red!Ohh and without a title tag this page is invalid... you know validation Ben ;-)