Using CSS3 to implement font color gradient

Using CSS3 to implement font color gradient

When using Animation.css, I found that the font of its official website would change gradually. I took a look at its css and it was very interesting.

  .site__title {
    color: #f35626;
    background-image: -webkit-linear-gradient(92deg, #f35626, #feab3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-animation: hue 60s infinite linear;
  }
@-webkit-keyframes hue {
    from {
      -webkit-filter: hue-rotate(0deg);
    }
    to {
      -webkit-filter: hue-rotate(-360deg);
    }
  }

Here we use -webkit-background-clip: text to crop the background image and leave only the text part.

Then use -webkit-text-fill-color: transparent to set the text fill color to transparent

Use hue animation to adjust the hue from 0deg to -360deg within 60s to achieve the effect of font color changing over time.

This is the end of this article about how to use CSS3 to implement font color gradient. For more relevant CSS3 font color gradient content, please search 123WORDPRESS.COM’s previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  React implements a general skeleton screen component example

>>:  Sitemesh tutorial - page decoration technology principles and applications

Recommend

Solution to MySQL connection exception and error 10061

MySQL is a relational database management system ...

Detailed explanation of JavaScript prototype and examples

Table of contents The relationship between the co...

The new version of Chrome browser settings allows cross-domain implementation

Preface Currently, the front-end solves cross-dom...

How to hide and remove scroll bars in HTML

1. HTML tags with attributes XML/HTML CodeCopy co...

Vue.js implements the nine-grid image display module

I used Vue.js to make a nine-grid image display m...

Mysql experiment: using explain to analyze the trend of indexes

Overview Indexing is a skill that must be mastere...

What does href=# mean in a link?

Links to the current page. ------------------- Com...

Example code for implementing hollowing effect with CSS

Effect principle Mainly use CSS gradient to achie...

Example code for implementing a QR code scanning box with CSS

We usually have a scanning box when we open the c...

Summary of JavaScript custom object methods

Table of contents 1. Use object to create an obje...

Summary of commonly used SQL in MySQL operation tables

1. View the types of fields in the table describe...

The difference between VOLUME and docker -v in Dockerfile

There are obvious differences between volume moun...

Implementation of breakpoint resume in Node.js

Preface Normal business needs: upload pictures, E...