1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 利用css3制作旋转动画【HTML】

利用css3制作旋转动画【HTML】

时间:2024-06-29 18:10:02

相关推荐

利用css3制作旋转动画【HTML】

web前端|html教程

利用css3制作旋转动画

web前端-html教程

利用css3功能强大,我们可以直接完成旋转动画的制作,而跳过复杂的javascript。

仿米折网源码,vscode能改语言吗,ubuntu横线闪烁,tomcat 部署后空白,厨房银色爬虫,php 数据倒序,网站seo技术分析是什么,响应式网站后台,齐博黄页模板lzw

html代码如下:demo01.html

提供彩票源码下载,vscode md文件图片,ubuntu系统mac,利用ip访问tomcat,c sqlite附加数据库,python网络爬虫反爬虫,php 获取方法名,seo软文营销霸屏,动易网站cms,pp模板 免费lzw

旋转动画

1

2

3

4

5

6

7

8

9

css代码如下:demo01.css .container{width:210px;height:140px;position:relative;//3d视距,当为元素定义 perspective 属性时,其子元素会获得透视效果,而不是元素本身perspective:1000px;margin:50px auto 40px; } #around{width:100%;height:100%;//规定如何在 3D 空间中呈现被嵌套的元素transform-style:preserve-3d;position:absolute;//定义动画animation:myMove 10s infinite; } #around figure{display:block;position:relative;width:186px;height:116px;left:10px;top:10px;border:2px solid black;text-align:center;color:white;font-weight:bold;//与高度相等,使内容垂直居中显示line-height:116px; } #around figure:nth-child(1){transform: rotateY(0deg) translateZ(288px);background-color:red; } #around figure:nth-child(2){transform: rotateY(40deg) translateZ(288px);background-color:orange; } #around figure:nth-child(3){transform: rotateY(80deg) translateZ(288px);background-color:yellow; } #around figure:nth-child(4){transform: rotateY(120deg) translateZ(288px);background-color:green; } #around figure:nth-child(5){transform: rotateY(160deg) translateZ(288px);background-color:darkgreen; } #around figure:nth-child(6){transform: rotateY(200deg) translateZ(288px);background-color:blue; } #around figure:nth-child(7){transform: rotateY(240deg) translateZ(288px);background-color:purple; } #around figure:nth-child(8){transform: rotateY(280deg) translateZ(288px);background-color:navy; } #around figure:nth-child(9){transform: rotateY(320deg) translateZ(288px);background-color:pink; } #keyframes myMove{ from{transform: rotateY(360deg); } to{transform: rotateY(0deg); }}

视频电话客户端源码,ubuntu下 文件复制,爬虫有哪些虫子,php程序员适合做多久外包,seo超级盒子lzw

完成后的图示如下:

图片可以自动旋转。修改animation属性里的值可以实现无限循环(infinite)和多次循环(ease n).

如:animation:myMove 10s ease 2. myMove为动画函数,10s为完成动画所用时间。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。