CSS3 gradient (gradients)-Radial gradient

Source: Internet
Author: User

CSS3 Radial Gradient-radial-gradient ()/repeating-radial-gradient ()

A radial gradient is defined by its center.

Create a radial gradient that defines at least two color nodes to render a smooth, excessive color. You can also specify the center of the gradient, the shape (round or oval), and the size.

By default, the centre of the gradient is center (represented in the center), the shape of the gradient is ellipse (representing the ellipse), and the size of the change is Farthest-corner (indicated to the farthest corner)

Grammar:

Background:radial-gradient (center, shape size, Start-color, ..., last-color);

1. Radial gradient-By default, the color nodes are evenly distributed

    . Divone{        background:radial-gradient (Red,green,blue);    }     . divtwo{        background:radial-gradient (Red,blue);         Width:100px;    }

2. Radial gradient-Specify shape

    . Divone{        background:radial-gradient (Circle,red,blue);    }     . divtwo{        background:radial-gradient (Ellipse,red,blue);    }

3. Radial gradient-Specify position

. Divone {    /* low version of Google, also does not support the specified central location */    background:radial-gradient (Red, Green,blue);     background:-webkit-radial-gradient (Bottom,red,green,blue);} . Divtwo {    background:radial-gradient (red,blue);     background:-webkit-radial-gradient (top,red,blue);     width:100px;}

4. Radial gradient-Uneven color:

. Divone {    background:radial-gradient (Red 10%,green 30%,blue 60%);} . Divtwo {    background:radial-gradient (Red 20%,blue 60%,green 10%);     Width:100px;}

5. Radial gradient-size designation , use of different size and size keywords,

The size parameter defines the scale of the gradient, the first parameter is the horizontal direction width, the second parameter is the vertical direction parameter, the corresponding keyword

    • Closest-side
    • Farthest-side
    • Closest-corner
    • Farthest-corner
. Divone{/*low version of Google also does not support, need to prefix*/background:radial-gradient (60% 30%, Closest-side, Red, blue);background:-webkit-radial-gradient (60% 30%, Closest-side, Red, blue);}. Divtwo{background:radial-gradient (60% 30%, Farthest-side, Red, blue);background:-webkit-radial-gradient (60% 30%, Farthest-side, Red, blue);}. Divthree{background:radial-gradient (60% 30%, Closest-corner, Red, blue);background:-webkit-radial-gradient (60% 30%, Closest-corner, Red, blue);}. Divfourth{background:radial-gradient (60% 30%, Farthest-corner, Red, blue);background:-webkit-radial-gradient (60% 30%, Farthest-corner, Red, blue);}

6. Repeating radial gradient-repeating-radial-gradient ()

{    background: repeating-radial-gradient (red, yellow 10%, green 15%);}

More:

CSS3 gradient (gradients)-linear gradient

CSS3 gradient (gradients)-Radial gradient

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.