An example of how to use css radiation gradient to achieve light and shade effect

Source: Internet
Author: User

Now we can use the style css radiation gradient to achieve a text light and shade effect as shown in the following figure.

We can see the effect of similar beam irradiation on text, which highlights the text. This is easy to implement. You only need to center the text and set the radiation gradient of the background element from the center. The code is as follows:

 
The code is as follows: Copy code
// HTML code
< Div Class = "box"> like </ Div >
 
The code is as follows: Copy code
// CSS code:
. Box {
Width: 200px;
Height: 200px;
Font-size: 80px;
Line-height: 200px;
Text-align: center;
Background:-webkit-radial-gradient (# feb3ad, # fd695d );
Background:-o-radial-gradient (# feb3ad, # fd695d );
Background:-moz-radial-gradient (# feb3ad, # fd695d );
Background: radial-gradient (# feb3ad, # fd695d );
}

In this way, the most basic light and shade background effect is complete. You can adjust the color to set the brightness of the light and shade. The closer the light is to the brighter the white color. Adjust the halo effect range by adjusting the percentage of central colors, as shown in Figure 5.20.

Adjust the halo effect

Compared with images, developers can change the effect by directly adjusting the parameters in CSS code, greatly improving the flexibility and development speed.

Related Article

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.