Home > Web Front-end > HTML Tutorial > How to make fonts automatically change color in html

How to make fonts automatically change color in html

藏色散人
Release: 2023-01-03 09:25:29
Original
9417 people have browsed it

htmlHow to make the font automatically change color: First create a new html file; then in the style tag, enter the css code such as "@keyframes change {0% {color: #333;}50% {color: #f60;}...}" to make the font automatically change color.

How to make fonts automatically change color in html

The operating environment of this article: Windows7 system, HTML5&&CSS3, Dell G3 computer

1. First, open the html editor and create a new html file, for example :index.html.

How to make fonts automatically change color in html

2. In the

body {
animation: change 3s linear 0s infinite;
}
@keyframes change {
0% {color: #333;}
50% {color: #f60;}
100% {color: #f00;}
}
Copy after login

How to make fonts automatically change color in html

[Recommended: HTML video tutorial]

3. The browser runs the index.html page, and the font color will change Automatically changes with time.

How to make fonts automatically change color in html

The above is the detailed content of How to make fonts automatically change color in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template