One, CSS3 defines two types of gradients.
1. Linear gradient (Linear gradients)-gradient down, up, left, right, diagonal.
2, radial gradient (Radial gradients)-gradient from the center outward.
Grammar:
Background-color:linear-gradient (direction, Color1, Color2, Color3, Color4, ...);
Second, from left to right gradient
#GradientColor {
Background:-webkit-linear-gradient (left Top, red, blue); /** Safari and Google **/
Background:-o-linear-gradient (left Top, red, blue); /** Opera **/
Background:-moz-linear-gradient (left Top, red, blue); /** Firefox **/
Background:-ms-linear-gradient (left Top, red, blue); /** IE **/
}
Three, gradient from the angle (from the inward and outward gradient)
#GradientColor {
Background:-webkit-linear-gradient (45deg, red, blue); /** Safari and Google **/
Background:-o-linear-gradient (45deg, red, blue); /** Opera **/
Background:-moz-linear-gradient (45deg, red, blue); /** Firefox **/
Background:-ms-linear-gradient (45deg, red, blue); /** IE **/
}
CSS3 gradients Gradient