实例:网格图库
技术栈:HTML+CSS+JS
效果:
源码:
【HTML】
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>网格图库</title>
<link rel="stylesheet" href="243.css">
</head>
<body>
<main class='gallery'>
<div class='item' data-pos='0'><img src='https://picsum.photos/400/300?random=0'></div>
<div class='item' data-pos='1'><img src='https://picsum.photos/400/300?random=1'></div>