CSS3 animation属性 实现转动效果

CSS3 animation属性 实现转动效果
  

<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<meta charset="utf-8">

<title>旋转效果</title>

<style>



div {

width:100%;

margin:50px auto;

text-align: center;


}


img {

width: 200px;

height: 200px;

border-radius: 100px;

animation: run 5s linear infinite;

-webkit-animation: run 5s linear infinite;

animation-play-state: running;

-webkit-animation-play-state: running;

}


img:hover {

animation-play-state: paused;

-webkit-animation-play-state: paused;

}


@keyframes run {

0% {

transform: rotate(0deg);

}


100% {

transform: rotate(360deg);

}

}


@-webkit-keyframes run {

0% {

transform: rotate(0deg);

}


100% {

transform: rotate(360deg);

}

}

</style>

</head>


<body>

<div>

<img src="bg.webp" />

</div>

</body>


</html>

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部