css图片旋转与隐藏
通过animation与keyframes实现图片旋转,在旋转时加透明属性
案例代码
<!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">
<title>Document</title>
<style>
.a {
position: absolute;
top: 450px;
left: 450px;
width: 500px;
height: 500px;
border: 1px solid red;
background-color: pink;
/*
animation-iteration-count
infinite: 无限循环
: 指定对象动画的具体循环次数 (也可不加尖括号
*/
animation: fadenum linear 8s infinite;
}
@keyframes fadenum {
0%{opacity: 1;}
25% { opacity: 0}
50%{opacity: 0;}
75% { opacity: 0}
100% {
opacity: 1;
transform: rotateY(360deg);
}
}
.b {
position: absolute;
top: 450px;
left: 450px;
width: 500px;
height: 500px;
animation: aa linear 8s infinite;
}
@keyframes aa {
0%{opacity: 0;}
25% { opacity: 0}
50%{opacity: 1;}
75% { opacity: 0}
100% {
opacity: 0;
transform: rotateY(360deg);
}
}
.a img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
/*z-index:1;*/
/*backface-visibility:hidden;*/
}
.b img {
top: 0;
left: 0;
width: 100%;
height: 100%;
/*transform: rotateY(180deg);*/
}
</style>
</head>
<body>
<div class="a">
<img src="../../../../../../common/img/sbkQjfxDP/01/社保卡主图/社保卡.png">
</div>
<div class="b">
<img src="../../../../../../common/img/sbkQjfxDP/01/社保卡主图/社保卡主图数字底左.png"/>
</div>
</body>
</html>
浙公网安备 33010602011771号