Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize Bird with css3

Shulou Source: shulou.com Published: 2022-06-01 06:55:10 10月02日 Update

这篇文章主要介绍了css3怎么实现小鸟的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇css3怎么实现小鸟文章都会有所收获,下面我们一起来看看吧。

css3 写小鸟的核心原理是用到了css3 的自定义动画属性keyframes ,它很灵活,允许你创建更多不一样的动画效果。写法

@keyframes myName

{

0% {xxxx}

10% {xxxx}

20% {xxxx}

30% {xxxx}

}

小鸟的代码片段是这样的,通过调用不同的背景图片

@keyframes myFrist

{

0% {background:url(images/bird1.png);background-size: 100% 100%}

12.5% {background:url(images/bird2.png);background-size: 100% 100%}

25% {background:url(images/bird3.png);background-size: 100% 100%}

37.5% {background:url(images/bird4.png);background-size: 100% 100%}

50% {background:url(images/bird5.png);background-size: 100% 100%}

65.7% {background:url(images/bird6.png);background-size: 100% 100%}

75% {background:url(images/bird7.png);background-size: 100% 100%}

87.5% {background:url(images/bird8.png);background-size: 100% 100%}

100% {background:url(images/bird1.png);background-size: 100% 100%}

}

关于"css3怎么实现小鸟"这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对"css3怎么实现小鸟"知识都有一定的了解,大家如果还想学习更多知识,欢迎关注行业资讯频道。

Tags: Birds knowledge content animation more articles different code value writing principles pictures attributes simple operation effects articles easy to understand core fragments see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Microsoft Xiaomi vpn