-
Notifications
You must be signed in to change notification settings - Fork 0
/
caption_opacity_n_scale.css
57 lines (55 loc) · 1009 Bytes
/
caption_opacity_n_scale.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
body{
padding: 1rem;
}
.gallery{
display: grid;
list-style-type: none;
padding: 0;
margin: 0;
grid-gap: 1rem;
grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
grid-auto-rows: 300px;
grid-auto-flow: dense;
}
/*this is added*/
.gallery li figure{
margin: 0;
width: 100%;
height: 100%;
position: relative;
}
/* ---------------- */
.wide{
grid-column: span 2;
}
.tall{
grid-row: span 2;
}
img{
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
/* Add effect here */
/*image show top above*/
.gallery figure figcaption{
position: absolute;
top: 0;
left: 0;
background: #fff;
width: calc(100% - 2rem);
height: calc(100% - 2rem);
margin: 1rem;
text-align: center;
display: grid;
align-content: center;
transition: filter .3s ease-in-out;
filter: opacity(0);
}
.gallery figure p{
font-style: italic;
}
.gallery figure figcaption:hover{
filter: opacity(80%);
}