Skip to content

Instantly share code, notes, and snippets.

@BigAB
Last active July 12, 2016 01:32
Show Gist options
  • Save BigAB/1571951 to your computer and use it in GitHub Desktop.
Save BigAB/1571951 to your computer and use it in GitHub Desktop.
Body 100% height when content has margin problem
/**
* Body 100% height when content has margin problem
*/
html, body {
position: relative;
min-height: 100%;
background: yellow;
margin: 0;
padding: 0.1px; /* needed to prevent the margin problem */
box-sizing: border-box;
}
html {
height: 100%;
background: blue;
}
.demo {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
height:1000px;
margin: 1em;
}
<!-- content to be placed inside <body>…</body> -->
<div class="just a little demo div"></div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment