How CSS implements an instance of a text color gradient

Source: Internet
Author: User

Objective

The main use of the three CSS properties:

  1. Linear-gradient () the image used to implement the gradient

  2. Background-clip the area to which the background image of the specified object is cropped out

  3. text-fill-color The fill color of the specified text

Instance

      Background:linear-gradient (to bottom, #fff 0, #333 100%);      Background-clip:text;      -webkit-background-clip:text;      text-fill-color:transparent;      -webkit-text-fill-color:transparent;

Linear-gradient () can specify the gradient angle and color, which is the color transform from top to bottom in the example

Background-clip:text the shape of the text as a clipping area

Text-fill-color:transparent the fill color of text is transparent

The effect is as follows:

  

    

Compatibility

Chrome and newer versions of Firefox support Background-clip and Text-fill-color attributes, with-webkit-prefixes

IE does not support the text value of the Background-clip property

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.