CSS/HTML

推荐列表 站点导航

当前位置:首页 > 脚本编程 > CSS/HTML >

css怎么设置图片不停旋转

来源:网络整理  作者:  发布时间:2020-12-16 18:41
css设置图片不停旋转的方法:可以通过使用animation属性和transform属性来进行设置,如【-webkit-transform: rotate(360deg);ani...
<div class="demo"> <img class="an img" src=https://www.ym97.com/"/test/img/2.png" width="500" height="500"/> </div>

旋转代码:

none 定义不进行转换。

animation-fill-mode 规定当动画不播放时(当动画完成时,或当动画有一个延迟未开始播放时),要应用到元素的样式。

(学习视频分享:css视频教程

animation动画属性
animation: name duration timing-function delay iteration-count direction fill-mode play-state;

属性值:

transform: none|transform-functions;

属性值:

Transform属性应用于元素的2D或3D转换。这个属性允许你将元素旋转,缩放,移动,倾斜等。

css怎么设置图片不停旋转

72ecf3bd4847d7396cb1ec9fe1d4399.png

代码实现:

matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) 定义 3D 转换,使用 16 个值的 4x4 矩阵。

initial 设置属性为其默认值。

相关属性:

animation-direction 指定是否应该轮流反向播放动画。

css设置图片不停旋转的方法:

html代码:

translate(x,y) 定义 2D 转换。

inherit 从父元素继承属性。

.demo{ text-align: center; margin-top: 100px; } @-webkit-keyframes rotation{ from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(360deg);} } .an{ -webkit-transform: rotate(360deg); animation: rotation 3s linear infinite; -moz-animation: rotation 3s linear infinite; -webkit-animation: rotation 3s linear infinite; -o-animation: rotation 3s linear infinite; } .img{border-radius: 250px;}

实现效果:

本教程操作环境:windows10系统、css3版,该方法适用于所有品牌电脑。

animation-timing-function 设置动画将如何完成一个周期

animation-iteration-count 定义动画的播放次数。

animation-play-state 指定动画是否正在运行或已暂停。

translate3d(x,y,z) 定义 3D 转换。

css设置图片不停旋转的方法:可以通过使用animation属性和transform属性来进行设置,如【-webkit-transform: rotate(360deg);animation: rotation;】。

matrix(n,n,n,n,n,n) 定义 2D 转换,使用六个值的矩阵。

animation-duration 动画指定需要多少秒或毫秒完成

animation-name 指定要绑定到选择器的关键帧的名称

animation-delay 设置动画在启动前的延迟间隔。

相关热词: CSS

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/cssm/4571.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

css怎么设置图片不停旋转

2020-12-16 编辑:

<div class="demo"> <img class="an img" src=https://www.ym97.com/"/test/img/2.png" width="500" height="500"/> </div>

旋转代码:

none 定义不进行转换。

animation-fill-mode 规定当动画不播放时(当动画完成时,或当动画有一个延迟未开始播放时),要应用到元素的样式。

(学习视频分享:css视频教程

animation动画属性
animation: name duration timing-function delay iteration-count direction fill-mode play-state;

属性值:

transform: none|transform-functions;

属性值:

Transform属性应用于元素的2D或3D转换。这个属性允许你将元素旋转,缩放,移动,倾斜等。

css怎么设置图片不停旋转

72ecf3bd4847d7396cb1ec9fe1d4399.png

代码实现:

matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) 定义 3D 转换,使用 16 个值的 4x4 矩阵。

initial 设置属性为其默认值。

相关属性:

animation-direction 指定是否应该轮流反向播放动画。

css设置图片不停旋转的方法:

html代码:

translate(x,y) 定义 2D 转换。

inherit 从父元素继承属性。

.demo{ text-align: center; margin-top: 100px; } @-webkit-keyframes rotation{ from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(360deg);} } .an{ -webkit-transform: rotate(360deg); animation: rotation 3s linear infinite; -moz-animation: rotation 3s linear infinite; -webkit-animation: rotation 3s linear infinite; -o-animation: rotation 3s linear infinite; } .img{border-radius: 250px;}

实现效果:

本教程操作环境:windows10系统、css3版,该方法适用于所有品牌电脑。

animation-timing-function 设置动画将如何完成一个周期

animation-iteration-count 定义动画的播放次数。

animation-play-state 指定动画是否正在运行或已暂停。

translate3d(x,y,z) 定义 3D 转换。

css设置图片不停旋转的方法:可以通过使用animation属性和transform属性来进行设置,如【-webkit-transform: rotate(360deg);animation: rotation;】。

matrix(n,n,n,n,n,n) 定义 2D 转换,使用六个值的矩阵。

animation-duration 动画指定需要多少秒或毫秒完成

animation-name 指定要绑定到选择器的关键帧的名称

animation-delay 设置动画在启动前的延迟间隔。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/cssm/4571.shtml

相关文章

风云图片

推荐阅读

返回CSS/HTML频道首页