-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard_flip.html
More file actions
48 lines (42 loc) · 945 Bytes
/
card_flip.html
File metadata and controls
48 lines (42 loc) · 945 Bytes
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
<div class="flip-card">
<div class="flip-inner">
<div class="flip-front">Front</div>
<div class="flip-back">Back</div>
</div>
</div>
<style>
.flip-card {
width: 150px;
height: 150px;
perspective: 1000px;
}
.flip-inner {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
transition: transform 0.6s;
}
.flip-card:hover .flip-inner {
transform: rotateY(180deg);
}
.flip-front,
.flip-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
color: white;
}
.flip-front {
background: #ff5722;
}
.flip-back {
background: #3f51b5;
transform: rotateY(180deg);
}
</style>