图标引入
<img class="icon" src="heart.svg" alt="" srcset="">
CSS代码
<style>
.icon {
animation:
bpm 1s linear,
pulse 0.75s 1s linear infinite;
}
@keyframes pulse {
from,
75%,
to {
transform: scale(1);
}
25% {
transform: scale(0.9);
}
50% {
transform: scale(1.2);
}
}
@keyframes bpm {
from {
transform: scale(0);
}
37.5% {
transform: scale(1.2);
}
75%,
to {
transform: scale(1);
}
}
</style>
更多【css-css心跳动画】相关视频教程:www.yxfzedu.com