HTML and CSS Reference
In-Depth Information
Opera did not support gradients until version 11, which was released in March 2011.
With the release of Opera 11.1, you can use both the
linear-gradient()
and
radial-gradient()
functions if you include the
-o-
browser prefix.
At the time of this writing, Internet Explorer 10 (currently in Beta) supports the
-ms-linear-gradient()
and
-ms-radial-gradient()
functions employing the
same syntax as the CSS3 functions. For earlier versions of Internet Explorer, you can
create a gradient only using the filter
Unlike the
CSS
radial-gradient()
function, you can cre-
ate only circular radial
gradients with WebKit's
gradient()
function.
Gradient(gradientType=
type
, startColorStr=
#rrggbb
,
endColorStr=
#rrggbb
)
where
type
is either 0 for a vertical gradient or 1 for a horizontal gradient,
startColorStr
indicates the starting color, and
endColorStr
indicates the end-
ing color. Color values must be entered as hexadecimals. The Internet Explorer filter
allows for transparent colors using the nonstandard hexadecimal string
#aarrggbb
,
where
aa
is the opacity value of the color in hexadecimal. An alpha value of 00 is
used for completely transparent colors, while a value of FF is used for completely
opaque colors. Thus, the
Gradient
filter
Gradient(gradientType=0, startColorStr=#33D333,
endColorStr=#005A7F00)
creates a vertical gradient that starts with a fully opaque dark green and blends into a
fully transparent medium green. Note that the
Gradient
filter does not support radial
gradients, nor does it allow for color stops within a gradient or for linear gradients in
directions other than horizontal or vertical.