Try setting the background on the <html> instead - may be easier to manage. Then give it a height:100%; as well so it for sure extends the whole page.
I also set it to no-repeat so you only get one gradient instead of it starting over at the bottom when you have longer content.
html{
height:100%;
background: linear-gradient(0deg, white, blue 80%) no-repeat;
}
http://jsfiddle.net/daCrosby/nEQeZ/1/
Edit
fr13d pointed out in the comments, when putting the gradient on html the gradient will stop on the bottom of the first page, prior to any scrolling. That is, the gradient gets cut off when you scroll (noticeable if the background color is different than the gradient's lower color).
One way around this is to put the styling on body instead:
body{
height:100%;
background: linear-gradient(0deg, yellow, blue 80%) no-repeat;
}
http://jsfiddle.net/daCrosby/nEQeZ/117/
Answer from DACrosby on Stack OverflowTry setting the background on the <html> instead - may be easier to manage. Then give it a height:100%; as well so it for sure extends the whole page.
I also set it to no-repeat so you only get one gradient instead of it starting over at the bottom when you have longer content.
html{
height:100%;
background: linear-gradient(0deg, white, blue 80%) no-repeat;
}
http://jsfiddle.net/daCrosby/nEQeZ/1/
Edit
fr13d pointed out in the comments, when putting the gradient on html the gradient will stop on the bottom of the first page, prior to any scrolling. That is, the gradient gets cut off when you scroll (noticeable if the background color is different than the gradient's lower color).
One way around this is to put the styling on body instead:
body{
height:100%;
background: linear-gradient(0deg, yellow, blue 80%) no-repeat;
}
http://jsfiddle.net/daCrosby/nEQeZ/117/
I agree with the solution from @DACrosby, but recommend to extend the background with 'fixed'. In that case your background will stay in place and you will have the gradient for the whole site not just on the top.
background: linear-gradient(0deg, red, blue 80%) fixed no-repeat;