首页 / 知识
Htlm实现图片3D旋转
2023-04-11 15:59:00

animation:用于设置六个动画属性 1.animation-name 规定需要绑定到选择器的 keyframe 名称。。 2.animation-duration 规定完成动画所花费的时间,以秒或毫秒计。 3.animation-timing-function 规定动画的速度曲线。 4.animation-delay 规定在动画开始之前的延迟。 5.animation-iteration-count 规定动画应该播放的次数。 6.animation-direction 规定是否应该轮流反向播放动画。 html代码: <html> <head></head> <body> <div id="logos"> <div id="cube" href="#"> <img src="${rt}/Others/test/imgs/mdnface.webp" id="front" alt="MDN" /> <img src="${rt}/Others/test/imgs/htmlface.webp" id="back" alt="HTML5" /> <span id="xaxis">x轴</span> <!-- x轴 --> <span id="yaxis">y轴</span> <!-- y轴 --> <span id="zaxis">z轴</span> <!-- z轴 --> </div> </div> </body> </html> css代码 #logos { position: relative; margin: 0 auto; -webkit-perspective: 822px; perspective: 822px; } #cube { display: block; position: relative; margin: 30px auto; height: 200px; width: 200px; -webkit-transform-style: preserve-3d; -webkit-transform: rotateX(-5deg) translateX(8px); transform-style: preserve-3d; transform: rotateX(-5deg) translateX(8px); } #front { position: absolute; height: 200px; width: 200px; -webkit-backface-visibility: visible; -webkit-transform: translateZ(100px); backface-visibility: visible; transform: translateZ(100px); } #back { position: absolute; height: 200px; width: 200px; -webkit-backface-visibility: visible; backface-visibility: visible; -webkit-transform: rotateY(180deg) translateZ(100px); transform: rotateY(180deg) translateZ(100px); } #cube { -webkit-animation: rotateGif 5s infinite linear; animation: rotateGif 5s infinite linear; } @-webkit-keyframes rotateGif { 0% { -webkit-transform: rotateY(0); } 100% { -webkit-transform: rotateY(360deg); } } @keyframes rotateGif { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } } #xaxis { -moz-transform-style: preserve-3d; -moz-transform: translate3d(-100px,0,0); -webkit-transform-style: preserve-3d; -webkit-transform: translate3d(-100px,0,0); -ms-transform-style: preserve-3d; -ms-transform: translate3d(-100px,0,0); -o-transform-style: preserve-3d; -o-transform: translate3d(-100px,0,0); transform-style: preserve-3d; transform: translate3d(-100px,0,0); border-bottom: black 1px solid; color: blue; width: 400px; display: block; position: absolute; top: 100px; height: 1px; } #yaxis { -moz-transform-style: preserve-3d; -moz-transform: rotateZ(-90deg) translate3d(0,-100px,0); -webkit-transform-style: preserve-3d; -webkit-transform: rotateZ(-90deg) translate3d(0,-100px,0); -ms-transform-style: preserve-3d; -ms-transform: rotateZ(-90deg) translate3d(0,-100px,0); -o-transform-style: preserve-3d; -o-transform: rotateZ(-90deg) translate3d(0,-100px,0); transform-style: preserve-3d; transform: rotateZ(-90deg) translate3d(0,-100px,0); border-bottom: green 1px solid; color: green; width: 400px; display: block; position: absolute; top: 100px; height: 1px; } #zaxis { -moz-transform-style: preserve-3d; -moz-transform: rotateY(90deg) translate3d(0,0,-100px); -ms-transform-style: preserve-3d; -ms-transform: rotateY(90deg) translate3d(0,0,-100px); -webkit-transform-style: preserve-3d; -webkit-transform: rotateY(90deg) translate3d(0,0,-100px); -o-transform-style: preserve-3d; -o-transform: rotateY(90deg) translate3d(0,0,-100px); transform-style: preserve-3d; transform: rotateY(90deg) translate3d(0,0,-100px); border-bottom: red 1px solid; color: red; width: 400px; display: block; position: absolute; top: 100px; height: 1px; } |
最新内容
相关内容
python如何读取列表中元素的位置?
python如何读取列表中元素的位置?,位置,数据,异常,培训,字符串,元素,索引,方法,示例,结果,python读取列表中元素位置的方法:1、使用index()方python终端输出乱码怎么解决?
python终端输出乱码怎么解决?,代码,系统,一致,培训,地方,工作,终端,文件,乱码,声明,在命令行终端上工作时,经常会碰到一个头疼的问题就是中文文本处理用c还是用python
文本处理用c还是用python,位置,培训,包装,对比,字符串,函数,文本,语言,字符,效率,文本处理python与c的对比:如下c++语言:C++语言实现C++中没有python支持r语言吗?
python支持r语言吗?,代码,名称,培训,官网,第一,语言,对象,字符串,方法,后缀,python中可以支持r语言。python提供了一个模块rpy2,可以较好地完python3如何引入模块?
python3如何引入模块?,系统,位置,培训,标准,模块,方法,成员,路径,下面,别名,使用Python进行编程时,有些功能没必须自己实现,可以借助Python现有python使用matplotlib绘图怎么在线
python使用matplotlib绘图怎么在线上标注?,地方,培训,坐标轴,图像,范围,画图,示例,注释,文字描述,以上,python画图常用标注包含,坐标轴的值和python如何replace(替换)多个字符?
python如何replace(替换)多个字符?,培训,字符,字符串,方法,正则,括号,数组,函数,定义,以上,python中使用replace替换多个字符的方法:1、使用repython3中怎么编写类?
python3中怎么编写类?,培训,方式,步骤,关键字,以上,过程,方法,更多,内容,python中创建类的方法:方式一:利用class关键字classChinese(object):python可以编写win程序吗?
python可以编写win程序吗?,培训,程序,文件,内容,文件夹,模块,命令,实际,下面,根据,python可以编写win程序。win程序的格式是exe,下面我们就来python如何导入txt数据库?
python如何导入txt数据库?,数据,时间,代码,培训,数据库,函数,读数,数据表,以上,方法,python将TXT数据导入数据库的方法代码如下:#!/usr/bin/pypython怎么使用文件夹下的脚本?
python怎么使用文件夹下的脚本?,工作,培训,文件夹,脚本,文件,所在,方法,示例,路径,以上,python中使用文件夹下脚本的方法:将当前的工作目录(即python的三角函数在哪?
python的三角函数在哪?,标准,培训,函数,反函数,方法,下面,以上,更多,内容,python中的三角函数在python的标准库math中,math已经包含在你的标