Let’s dig a little deeper and see more cool stuff you can do. You can start doing advanced stuff and playing with shape combinations to create new effects.
The syntax is pretty simple, all you’ve got to do is separate multiple declarations with commas. Notice that the “z-index” of the gradients will be reversed and the first item will be at the top.
If you set the color to transparent, you can use a background color if you want. Otherwise the color of the top element will hide all the others.
Ok, let’s play with some code now:
#wd {
background:
-moz-linear-gradient( top left, white, transparent 25% ),
-moz-linear-gradient( bottom right, white, transparent 25% ),
-moz-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-moz-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-webkit-linear-gradient( top left, white, transparent 25% ),
-webkit-linear-gradient( bottom right, white, transparent 25% ),
-webkit-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-webkit-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-o-linear-gradient( top left, white, transparent 25% ),
-o-linear-gradient( bottom right, white, transparent 25% ),
-o-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-o-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-khtml-linear-gradient( top left, white, transparent 25% ),
-khtml-linear-gradient( bottom right, white, transparent 25% ),
-khtml-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-khtml-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-ms-linear-gradient( top left, white, transparent 25% ),
-ms-linear-gradient( bottom right, white, transparent 25% ),
-ms-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-ms-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
linear-gradient( top left, white, transparent 25% ),
linear-gradient( bottom right, white, transparent 25% ),
radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;}
The syntax is pretty simple, all you’ve got to do is separate multiple declarations with commas. Notice that the “z-index” of the gradients will be reversed and the first item will be at the top.
If you set the color to transparent, you can use a background color if you want. Otherwise the color of the top element will hide all the others.
Ok, let’s play with some code now:
#wd {
background:
-moz-linear-gradient( top left, white, transparent 25% ),
-moz-linear-gradient( bottom right, white, transparent 25% ),
-moz-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-moz-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-webkit-linear-gradient( top left, white, transparent 25% ),
-webkit-linear-gradient( bottom right, white, transparent 25% ),
-webkit-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-webkit-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-o-linear-gradient( top left, white, transparent 25% ),
-o-linear-gradient( bottom right, white, transparent 25% ),
-o-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-o-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-khtml-linear-gradient( top left, white, transparent 25% ),
-khtml-linear-gradient( bottom right, white, transparent 25% ),
-khtml-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-khtml-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
-ms-linear-gradient( top left, white, transparent 25% ),
-ms-linear-gradient( bottom right, white, transparent 25% ),
-ms-radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
-ms-radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;
background:
linear-gradient( top left, white, transparent 25% ),
linear-gradient( bottom right, white, transparent 25% ),
radial-gradient( 25% 50%, circle, white, white 20%, transparent 25% ),
radial-gradient( 75% 50%, contain, white, white 20%, transparent 25% )
black;}
Multiple gradients
Reviewed by owntuition
on
00:17
Rating:
No comments:
Post a Comment