Through cases, learn how to create simple animations with CSS3

青灯夜游
Release: 2020-12-25 09:50:28
forward
2206 people have browsed it

The following article uses a case to introduce how to use CSS3 to create simple animations. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Through cases, learn how to create simple animations with CSS3

Recommendation:css video tutorial

1.Easy loading

@keyframes myfirst { from{transform: rotate(0deg)}to{transform: rotate(360deg)} } .loading{ //infinite控制执行次数这里一直执行,linear执行速度,匀速 animation: myfirst 1.5s infinite linear; border: 16px solid #f3f3f3; border-radius: 50%; border-top:16px solid blue; width: 120px; height: 120px; } 
Copy after login

2.Easy Progress bar

.move { width: 0px; height: 10px; animation: moveHover 5s infinite linear; } 
Copy after login

3. Transition attribute

.change { transition: width 2s; font-size: 10px; width: 100px; height: 20px; background: yellow; -moz-transition: width 2s; /* Firefox 4 */ -webkit-transition: width 2s; /* Safari 和 Chrome */ -o-transition: width 2s; /* Opera */ } .change:hover { width: 500px; } 
鼠标滑过
Copy after login
.bigger{ font-size: 20px; width: 0; height: 0;//scale根据宽高变大,必须设置width和height background: #2A9F00; transition: transform 5s; } .bigger:hover{ transform: scale(10); } 
Copy after login

For more programming-related knowledge, please visit:Introduction to Programming! !

The above is the detailed content of Through cases, learn how to create simple animations with CSS3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!