From ffe4db83dee5c4b90794da8d73a0e5cd159f54f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Thu, 20 Jun 2024 08:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- page-mastodon.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/page-mastodon.php b/page-mastodon.php index 8cd3eac..c588a1a 100644 --- a/page-mastodon.php +++ b/page-mastodon.php @@ -118,12 +118,14 @@ div p a { transition: transform .3s ease; /* 鼠标悬停时的过渡效果 */ cursor: zoom-in; /* 鼠标指针变为放大镜 */ } +img { + object-fit: cover; /* 保持图片的纵横比,但会将图片裁剪以填充容器 */ + object-position: center; /* 保证中央部分 */ +} /* 缩略图内的图片样式 */ .thumbnail-image img { width: 100%; - height: 100%; - object-fit: cover; /* 保持图片的纵横比,但会将图片裁剪以填充容器 */ - object-position: center; /* 保证中央部分 */ + min-height: 200px; } /* 当屏幕宽度小于732px时 */ @media (max-width: 732px) { @@ -136,6 +138,10 @@ div p a { .resimg { grid-template-columns: 1fr; /* 修改为一列 */ } + .thumbnail-image img { + width: 100%; + height: 480px; +} } .load-more-btn { display: block;