css实现图片相册网格拼贴布局效果代码
代码语言:html
所属分类:画廊相册
代码描述:css实现图片相册网格拼贴布局效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import "https://unpkg.com/open-props/open-props.min.css";
@import "https://unpkg.com/open-props/normalize.min.css";
*,
*:after,
*:before {
box-sizing: border-box;
}
body {
display: grid;
place-items: center;
min-height: 100vh;
font-family: 'Google Sans', sans-serif, system-ui;
width: 100vw;
overflow-x: hidden;
background: var(--surface-2);
}
ul {
--big-tile-size: 50vmin;
--scale: 0.4;
--rotation: 270deg;
--tile-size: calc(var(--big-tile-size) / 3);
list-style-type: none;
padding: 0;
margin: 0;
display: grid;
gap: 1vmin;
grid-template: repeat(9, var(--tile-size)) / repeat(9, var(--tile-size));
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(var(--scale));
}
img {
--rotation: -270deg;
--scale: 1;
height: 200%;
min-width: 200%;
aspect-ratio: 1;
-o-object-fit: cover;
object-fit: cover;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
li {
padding: 0;
position: relative;
background: h.........完整代码请登录后点击上方下载按钮下载查看
网友评论0