Reputation: 359
I am writing a website as part of my college course, but I have came across a problem. I can't seem to fit whole screen.
Please visit here to see what I mean: http://jsfiddle.net/xiiJaMiiE/gM3yk/
html, body
{
background-image: -webkit-gradient(linear, right bottom, right top, color-stop(0, #5977FF),
color-stop(1, #59C5FF));
background-image: -o-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -moz-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -webkit-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -ms-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: linear-gradient(to top, #5977FF 0%, #59C5FF 100%);
background-repeat:no-repeat;
background-size:cover;
background-
}
Thanks in advance
Upvotes: 0
Views: 185
Reputation: 15891
Give parent height
and width
, and a suggested way is, to use background-size:100% 100%;
rather than background-size:cover;
html, body {
background-image: -webkit-gradient(linear, right bottom, right top, color-stop(0, #5977FF), color-stop(1, #59C5FF));
height: 100%; /* added */
width: 100%; /* added */
background-image: -o-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -moz-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -webkit-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: -ms-linear-gradient(top, #5977FF 0%, #59C5FF 100%);
background-image: linear-gradient(to top, #5977FF 0%, #59C5FF 100%);
background-repeat:no-repeat;
background-size:100% 100%; /* updated*/
}
Upvotes: 0
Reputation: 636
You need to set the height of html/body to 100%;
height: 100%;
Upvotes: 4