HTML_css如何实现头像无限旋转动画特效

HTML_css如何实现头像无限旋转动画特效_第1张图片
主要使用了@keyframes和animation,以及指定infinite,播放次数不限来实现。
.html

<div class="wrap">
  <img class="rotate" src="./1.jpg" alt=""><br/>
    小歪
div>

.css

@keyframes rotation{
  from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.rotate{
    width: 100px;
    height: 100px;
    animation: rotation 3s linear infinite;
    border-radius: 250px;
    border: 4px solid rgba(255, 255, 255, .6);
}
.wrap{
	padding: 16px;
	text-align: center;
	background: #eee;
}

你可能感兴趣的:(HTML)