我是靠谱客的博主 搞怪耳机,这篇文章主要介绍css3实现旋转相册效果,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>旋转相册</title> <style type="text/css"> body,div,p,ul,ol,li,dl,dt,dd,table,tr,td,form,hr,fieldset,h1,h2,h3,h4,h5,h6,img,input{ margin:0; padding:0; } body{ background: black; } .content{ width: 200px; height: 150px; position: relative; margin:200px auto 0; perspective: 1500px; } .box{ width: 200px; height: 150px; transform-style: preserve-3d; transform:rotateX(-30deg); animation:photo 15s linear infinite; } .box:hover{ animation:photo 15s linear infinite paused; } .box img{ width: 200px; height: 150px; position: absolute; left: 0; top: 0; transform-style: preserve-3d; transition: all 1s; } .box img:nth-child(1){ transform:translateZ(280px); } .box img:nth-child(2){ transform:rotateY(40deg) translateZ(280px); } .box img:nth-child(3){ transform:rotateY(80deg) translateZ(280px); } .box img:nth-child(4){ transform:rotateY(120deg) translateZ(280px); } .box img:nth-child(5){ transform:rotateY(160deg) translateZ(280px); } .box img:nth-child(6){ transform:rotateY(200deg) translateZ(280px); } .box img:nth-child(7){ transform:rotateY(240deg) translateZ(280px); } .box img:nth-child(8){ transform:rotateY(280deg) translateZ(280px); } .box img:nth-child(9){ transform:rotateY(320deg) translateZ(280px); } .box img:nth-child(1):hover{ transform:translateZ(280px) scale(1.2); } .box img:nth-child(2):hover{ transform:rotateY(40deg) translateZ(280px) scale(1.2); } .box img:nth-child(3):hover{ transform:rotateY(80deg) translateZ(280px) scale(1.2); } .box img:nth-child(4):hover{ transform:rotateY(120deg) translateZ(280px) scale(1.2); } .box img:nth-child(5):hover{ transform:rotateY(160deg) translateZ(280px) scale(1.2); } .box img:nth-child(6):hover{ transform:rotateY(200deg) translateZ(280px) scale(1.2); } .box img:nth-child(7):hover{ transform:rotateY(240deg) translateZ(280px) scale(1.2); } .box img:nth-child(8):hover{ transform:rotateY(280deg) translateZ(280px) scale(1.2); } .box img:nth-child(9):hover{ transform:rotateY(320deg) translateZ(280px) scale(1.2); } @keyframes photo{ 0%{ transform:rotateX(-30deg) rotateY(0deg); } 100%{ transform:rotateX(-30deg) rotateY(360deg); } } </style> </head> <body> <div class="content"> <div class="box"> <img src="img/img1.jpg" alt=""/> <img src="img/img2.jpg" alt=""/> <img src="img/img3.jpg" alt=""/> <img src="img/img4.jpg" alt=""/> <img src="img/img5.jpg" alt=""/> <img src="img/img6.jpg" alt=""/> <img src="img/img7.jpg" alt=""/> <img src="img/img8.jpg" alt=""/> <img src="img/img9.jpg" alt=""/> </div> </div> </body> </html>

最后

以上就是搞怪耳机最近收集整理的关于css3实现旋转相册效果的全部内容,更多相关css3实现旋转相册效果内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(101)

评论列表共有 0 条评论

立即
投稿
返回
顶部