Safari 4
Firefox 3.6
Opera
Chrome
Internet Explorer
- The basic syntax for Firefox's Linear Gradients is: background-image:-moz-linear-gradient([<point> | | <angle>,] , start color value, end color value, [(stopping color value, offset percentage),...] );
- -moz-linear-gradient is a property value of background;
- The first set of parameters <angle position> is very flexible, its basic composition is the position <point> (the starting point of the gradient) and the angle;
- <point> The starting point of the gradient: It can be specified as a percentage, pixels, or using "left", "center", or "right" for horizontal and "top", "center", or "bottom" for vertical positioning. The position is from the upper left corner of the most affected element.
- If it's only a horizontal gradient, just set: "left center" or "right center". If it's a vertical gradient, set "center top" or "center bottom". In Firefox, "center" can be omitted, so if it's only a horizontal gradient, just set: "left" or "right", and if it's a vertical gradient, set "top" or "bottom".
- If these two values are percentages, then the first one is the horizontal gradient position, and the second one is the vertical gradient position. At this time, an angle value is also needed, such as "9deg"; you can see the examples on this page;
- It can also be just an angle value.
- (start color value), (end color value) are two gradient color values;
- [(stopping color value, offset percentage),...]: Multiple color-stops can be used. If the gradient only has two colors, this parameter can be omitted; the offset must be between % and 100%;
- WebKit-based Safari and Chrome's Linear Gradients
- For IE, you can use gradient filters, please refer to: http://msdn.microsoft.com/en-us/library/ms532997(VS.85).aspx