W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: [CSS3] linear-gradient() proposal

From: Alan Gresley <alan@css-class.com>
Date: Mon, 28 Mar 2011 00:46:51 +1100
Message-ID: <4D8F3FCB.7030105@css-class.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: Andrew Fedoniouk <andrew.fedoniouk@live.com>, www-style@w3.org
On 27/03/2011 4:15 PM, Andrew Fedoniouk wrote:

> Position of this rectangle inside background box of the element is defined
> by the <background-position>, see:
> http://www.w3.org/TR/CSS2/colors.html#propdef-background-position
>
> So syntax of linear-gradient() declaration will look like this:
>
> <linear-gradient> = linear-gradient(
> [ <background-position> || <angle> ,]? <color-stop>[, olor-stop>]+ );
>
> Here is an illustration of such "gradients with alignment":
> http://terrainformatica.com/w3/linear-align-1.png


You can use background-size with gradients.

<!DOCTYPE html>
<style type="text/css">
div {
height: 200px; width: 200px;
-moz-border-radius: 100px 100px;
border-radius: 100px 100px;
background: #385179;
background: #385BE1 -moz-radial-gradient(rgba(255,255,255,1), 
rgba(56,91,225,0)) -50px -50px no-repeat;
background: #385BE1 -webkit-gradient(radial, 125 125, 0, 125 125, 150, 
from(rgba(255,255,255,1)), to(rgba(56,91,225,0))) -50px -50px no-repeat;
-moz-background-size: 250px 250px;
background-size: 250px 250px;
}
</style>
<div></div>


Also the I believe the current CSS gradient behavior is the same as SVG 
gradients.



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Sunday, 27 March 2011 13:47:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT