Gradient backgrounds can give depth and perspective to your site, and appear most pleasing when grading from dark at the top to lighter at the bottom. For gradient backgrounds, you need a default color as a fallback and three styles to cover the main browser types. The gradient will fill the background of the page competely regardless of how far it scrolls.
- Add the following rule to your core CSS style sheet (the rule shown applies the color #024668 at the top and #006699 at the bottom as an example):
background: #006699; /* default background color */
background: -moz-linear-gradient(top, #024668, #006699); /* for Firefox: */
background: -webkit-gradient(linear, left top, left bottom, from(#024668), to(#006699)); /* for Chrome and Safari:*/
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#024668', EndColorStr='#006699', GradientType=0); /* for Microsoft Internet Explorer */
- For further exploration into CSS gradients, go to ColorZilla’s Ultimate CSS Gradient Generator.