-
Notifications
You must be signed in to change notification settings - Fork 0
/
card.css
69 lines (58 loc) · 1.18 KB
/
card.css
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
.cards{
position: relative;
display: flex;
justify-content: center;
align-items: center;
/*允许换行*/
flex-wrap: wrap;
padding: 20px;
}
.card{
position: relative;
width: 150px;
height: 200px;
background-color: #fff;
/*上下是30px 左右是15px*/
margin: 20px 8px;
border-radius: 5px;
box-shadow: 0 5px 200px rgb(0, 0, 0,0.5);
/*动画过渡 提高体验感*/
transition: 0.3s ease-in-out;
}
.card:hover{
height: 260px;
}
.img-box{
position: relative;
width: 100px;
height: 100px;
border-radius: 5px;
overflow: hidden;
top: -50px;
left: 15px;
box-shadow: 0 5px 200px rgb(0, 0, 0,0.2);
}
.img-box img{
width: 100%;
}
.text-box{
position: relative;
margin-top: -60px;
padding: 5px 10px;
text-align: center;
color: black;
/*设置元素不可见*/
visibility: hidden;
/*不透明度*/
opacity: 0;
/*动画过渡*/
transition: 0.3s ease-in-out;
}
.text-box p{
text-align: center;
}
.card:hover .text-box{
visibility: visible;
opacity: 1;
transition-delay: 0.1s;
}