Gradients are usually one color that fades into another, but CSS gives you the control to set how that happens. You can set
the direction and much more. While declaring a solid color uses the background-color property in CSS, gradients use background.
How we apply gradients has evolved quite a bit over the past few years. So we are showing you the "new way" and the "old way" of styling
for gradients. The newer syntax is needed by standard-compliant browsers (Opera 12.1, IE10, Firefox 16, Chrome 26, Safari 6.1 If you need
to support older browsers, you will need to use the old prefixed syntax.
Below are two examples: one for a
linear gradient and one for a radial gradient. We frequently use one or
both of these in our templates.
background-image: radial-gradient(center, circle cover, #aba873, #625d30);
background-image: -moz-radial-gradient(center, circle cover, #aba873,
#625d30);
background-image: -webkit-radial-gradient(center center, circle cover,
#aba873, #625d30);
background-image: -ms-radial-gradient(center center, circle cover,
#aba873, #625d30);
background-image: -o-radial-gradient(center center, circle cover, #aba873,
#625d30);
}
Learn More:
Gradients can go from top to bottom, from side to side, on an angle, and can have multiple color values. They can be simple or they can be
quite complex. We have shown you only two simple examples to get you started.