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 Overflow
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ CSS โ€บ Reference โ€บ Values โ€บ gradient โ€บ linear-gradient
linear-gradient() - CSS - MDN Web Docs - Mozilla
The position of the gradient line's starting point. If specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom). The order of the side keywords does not matter.
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ tryit.asp
Linear Gradient - Top to Bottom
โฏRun Code Ctrl+Alt+R Save Code Ctrl+Alt+A Change Orientation Ctrl+Alt+O Change Theme Ctrl+Alt+D Go to Spaces Ctrl+Alt+P
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css3_gradients.asp
CSS Gradients
A value of 90deg is equivalent to "to right". A value of 180deg is equivalent to "to bottom". ... The following example shows a linear gradient (from left to right) with the color of the rainbow and some text:
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ almanac โ€บ functions โ€บ l โ€บ linear-gradient
linear-gradient() | CSS-Tricks
September 16, 2025 - By default, linear gradients go in a top-to-bottom direction (i.e., to bottom or 180deg), but we can rotate them as much as needed by setting <angle> or by using certain keywords.
๐ŸŒ
Team Treehouse
teamtreehouse.com โ€บ community โ€บ how-to-set-bottom-to-top-on-lineargradient-2
How to set bottom to top on linear-gradient? (Example) | Treehouse Community
September 7, 2015 - this is my answer .main-header{ background-image: linear-gradient(bottom to top, steelblue 0%, darkslateblue 90%); } It says I am not setting the gradient bottom to top ยท style.css ยท /* Complete the challenge by writing CSS below */ .main-header{ background-image: linear-gradient(bottom to top, steelblue 0%, darkslateblue 90%); } index.html ยท
๐ŸŒ
CodePen
codepen.io โ€บ hubspot โ€บ pen โ€บ bGmKYwJ
HTML Background Color - linear gradient top to bottom
<html lang=โ€enโ€> <head> <link ... <body> <h1>Linear Gradient</h1> <p>This linear gradient starts as white at the top and transitions to orange at the bottom.</p> </body> </html>...
๐ŸŒ
JetThoughts
jetthoughts.com โ€บ home โ€บ blog โ€บ how to use linear-gradient in css
How to use Linear-Gradient in CSS | JetThoughts Blog
October 15, 2025 - A value of 90deg is equivalent to right. A value of 180deg is equivalent to bottom. background-image: linear-gradient(135deg, blue, green); In this example shows a linear gradient (from top to bottom) with multiple color stops:
Find elsewhere
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ css-linear-gradient-explained-with-examples
CSS Linear Gradient Explained with Examples
February 1, 2020 - Hereโ€™s a sample for a gradient starting from the top-left: background: linear-gradient(to bottom right, red, yellow);
๐ŸŒ
ColorGradient
colorgradient.dev โ€บ linear-gradient
Linear Gradient
You can optionally specify the line the gradient must follow by setting an angle or the side-or-corner argument. The simplest scenario will create a gradient of one point to another, the gradient line will go from top to bottom with the colors starting on both ends.
๐ŸŒ
Quackit
quackit.com โ€บ css โ€บ functions โ€บ css_linear-gradient_function.cfm
CSS linear-gradient() Function
Linear gradients are created by establishing an axis called the gradient line. Color stops are then placed along that gradient line to create a gradient that runs between each color. You can set the angle of the gradient line so that the gradient runs along that angle.
๐ŸŒ
MarkSheet
marksheet.io โ€บ css-gradients.html
CSS gradients - Free tutorial to learn HTML and CSS
But itโ€™s quite easy to write more subtle gradients, especially for buttons: .button-grey { background-image: linear-gradient(#f2f2f2, #f2f2f2);} .button-yellow{ background-image: linear-gradient(#fce374, #fcdf5b);} .button-orange{ background-image: linear-gradient(#f58a38, #f57c20);} .button-red { background-image: linear-gradient(#ed6d64, #ed574c);} .button-purple{ background-image: linear-gradient(#847bba, #7568ba);} .button-blue { background-image: linear-gradient(#42b0e3, #2ba9e3);} .button-green { background-image: linear-gradient(#97cc76, #8bcc62);}
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ css โ€บ how-to-use-linear-gradient-in-css
How to use Linear Gradient in CSS? - GeeksforGeeks
September 10, 2024 - The basic linear gradient is the most straightforward way to use the gradients in the CSS. It can involve specifying the two colors, with the browser automatically creating a smooth transition between them. The transition can occur in a straight line, typically from top to bottom, though you can control the direction by modifying the default behavior.
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ css3-gradients
CSS Gradients | CSS-Tricks
January 26, 2021 - Perhaps the most common and useful type of gradient is the linear-gradient(). The gradients โ€œaxisโ€ can go from left-to-right, top-to-bottom, or at any angle you chose.
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ a-complete-guide-to-css-gradients
CSS Gradients Guide | CSS-Tricks
August 12, 2024 - A gradient going from top to bottom is again at 90deg only in the old spec from ages ago. In this new spec, to bottom is equivalent to 180deg (not 0deg, thatโ€™s equivalent to a bottom to top gradient โ€“ hereโ€™s an ยท interactive demo showing how a linear-gradient() works).
๐ŸŒ
Medium
patrickbrosset.medium.com โ€บ do-you-really-understand-css-linear-gradients-631d9a895caf
Do you really know CSS linear-gradients? | by Patrick Brosset | Medium
April 10, 2015 - If the angle is omitted, it defaults to to bottom (which is 180deg or 0.5turn): ... In this picture and the following ones, the gradient box is the bordered rectangle, and the gradient line is the thick grey line that passes in the center and has the color stops displayed along. In the example above, the angle is missing, so the white-to-red gradient goes from top to bottom, which is the same as using the to bottom keyword, as shown below.
๐ŸŒ
Medium
beingrahulvyas.medium.com โ€บ uses-of-linear-gradient-in-css-df3e88df678d
Mastering Linear-Gradient in CSS: Tips and Tricks for Creating Stunning Backgrounds | Rahul Vyas | Medium
May 3, 2023 - By default, linear-gradient generates a gradient that goes from top to bottom, but you can easily change its direction using various options.