css: CodePen Home Minimal Responsive Thumbnail Gallery (Grid & Masonry)

 

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
120
121
122
123
124
125
126
127
128
129
130
131
132
<!doctype html>
<html>
<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>CodePen - Minimal Responsive Thumbnail Gallery (Grid & Masonry)</title>
        <meta name="Description" content="geovindu"/>
<meta name="Keywords" content="geovindu"/>
<meta name="author" content="geovindu"/>
  <script>
  if (document.location.search.match(/type=embed/gi)) {
    window.parent.postMessage("resize", "*");
  }
</script>
 
 
  <style>
    html { font-size: 15px; }
    html, body { margin: 0; padding: 0; min-height: 100%; }
    body { height:100%; display: flex; flex-direction: column; }
    .referer-warning {
      background: black;
      box-shadow: 0 2px 5px rgba(0,0,0, 0.5);
      padding: 0.75em;
      color: white;
      text-align: center;
      font-family: var(--cp-font-family);
      line-height: 1.2;
      font-size: 1rem;
      position: relative;
      z-index: 2;
    }
    .referer-warning h1 { font-size: 1.2rem; margin: 0; }
    .referer-warning a { color: #56bcf9; } /* $linkColorOnBlack */
       
      /** RESET **/
* {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
 
 
 
 
/** THUMBNAILS **/
.thumbnails {
  display: flex;
    flex-wrap: wrap;
}
.thumbnails a {
  flex-grow: 1;
  height: 200px;
  margin: 2px;
  border-radius: 2px;
  overflow: hidden;
}
.thumbnails img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.thumbnails a:hover img {
  transform: scale(1.05);
}
  </style>
     
 
</head>
 
<body>
    <!-- Grid Layout (thumbnail images have same dimensions) -->
<div class="thumbnails">
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?man" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?woman" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?design" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?sky" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?tree" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?cat" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?dog" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?office" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?sea" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?green" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?fashion" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?architecture" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?art" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?style" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?animal" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?home" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?flower" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?grass" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?market" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/500x300/?street" alt=""></a>
</div>
 
<br><br><br><br>
 
<!-- Masonry Layout (thumbnail images have random dimensions) -->
<div class="thumbnails">
    <a href="#"><img src="https://source.unsplash.com/featured/?man" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?woman" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?design" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?sky" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?tree" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?cat" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?dog" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?office" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?sea" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?green" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?fashion" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?architecture" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?art" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?style" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?animal" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?home" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?flower" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?grass" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?market" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?street" alt=""></a>
    <a href="#"><img src="https://source.unsplash.com/featured/?bird" alt=""></a>
</div>
<br><br><br><br>
     
</body>
</html>

  图片自适应显示器大小排列个数

from: https://codepen.io/AkinBilgic/pen/LwZNJm

 

posted @   ®Geovin Du Dream Park™  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
历史上的今天:
2015-11-25 csharp: 百度语音合成
2015-11-25 csharp:百度语音识别
2015-11-25 csharp: Sound recording
2010-11-25 颜色选择器 Color Picker,Internet Explorer,Firefox,Opera,Safar
< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5
点击右上角即可分享
微信分享提示