Template:Radial-gradient/doc

This template creates a radial gradient background. This currently works in Firefox (3.6 and up), Opera (12.0 and up), Safari (5.1 and up), Google Chrome (10 and up) and Internet Explorer 10.

Usage
Use within a CSS style tag. The template uses the  property.


 * 1)  – Mandatrory. Specify the X and Y position of the center of the gradient. This can be any valid CSS position value.
 * 2)  – Mandatory. Specify the shape of the gradient using keywords or CSS size values. Valid keywords are:
 * 3)  – Optional. Specify the size of the radial using keywords or CSS size values. Valid keywords are:
 * 4) * (or  ); Extends the radial to the farthest element corner, ensuring the gradient covers the entire element. This is the default.
 * 5) * ; Extends the radial to the closest corner.
 * 6) * ; Extends the radial to the farthest edge.
 * 7) * (or  ); Extends the radial to the closest edge, ensuring the gradient does not extend beyond the element's borders.
 * 8)  – The first two colors are mandatory. You can define any number of additional colors, separated with commas.
 * 9)  – Optional. You can specify a stop position for each color using a percentage (e.g. 45%) or pixels (e.g. 60px).
 * 1)  – The first two colors are mandatory. You can define any number of additional colors, separated with commas.
 * 2)  – Optional. You can specify a stop position for each color using a percentage (e.g. 45%) or pixels (e.g. 60px).

Examples

 * will produce

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


 * will produce

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


 * will produce

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Considerations
Above examples use contrasting colors to show the effect more clearly. It is best to use subtle differences in color to enhance the appearance, rather than radically change it. This also minimizes the effects between browsers that do and do not support gradients.

Compatibility

 * See radial-gradient on the Mozilla Developer Network for all broswer compatibility details.