.container {
maxwidth: 800px;
margin: 0 auto;
textalign: center;
}
.imggrid {
display: grid;
gridtemplatecolumns: repeat(4, 150px);
gap: 20px;
padding: 20px;
}
.imgbox {
border: 1px solid ccc;
cursor: pointer;
transition: all 0.3s;
}
.imgbox:hover {
boxshadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.imgtitle {
fontsize: 18px;
marginbottom: 5px;
}
// 假设这是获取图片的JavaScript代码,根据实际图片路径替换
var imgLinks = document.querySelectorAll('.imgbox');
imgLinks.forEach(img => {
img.addEventListener('click', function() {
var imgSrc = this.dataset.src;
window.open(imgSrc, '_blank');
});
});