CSS background 100% height
html,body{
background: linear-gradient(to right top, #336e7b 0%, #8e44ad 50%, #e74c3c 100%) repeat scroll 0 0 #abb7b7;
margin:0;
padding:0;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
JSFiddle: http://jsfiddle.net/losiuhoi/1ujk40wh/1/
How do I set the background of the body to 100% height?
+3
source to share
2 answers
Set body height to 100%, otherwise it only needs as much as needed for the content ( .msg
div).
html, body {
height: 100%;
}
Demo: http://jsfiddle.net/dfsq/1ujk40wh/2/
+3
source to share