From 79eaa7d4077c7eccb0dfd06458ed1b4bdf1b45f8 Mon Sep 17 00:00:00 2001 From: SwimmingLiu Date: Mon, 16 Sep 2024 20:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B4=E8=AF=B4=E7=BD=91=E9=A1=B5=E7=89=88?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=94=AF=E6=8C=81=E4=B9=9D=E5=AE=AB=E6=A0=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/ToolsUtil.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/util/ToolsUtil.py b/util/ToolsUtil.py index 4c146cb..2fe7f14 100644 --- a/util/ToolsUtil.py +++ b/util/ToolsUtil.py @@ -61,7 +61,6 @@ def show_author_info(): def get_html_template(): - # HTML模板 # HTML模板 html_template = """ @@ -108,17 +107,20 @@ def get_html_template(): }} .image {{ margin-top: 10px; - display: flex; - justify-content: space-around; - align-items: center; /* 使两张图片垂直对齐 */ - padding: 20px; + display: grid; + grid-template-columns: repeat(3, 1fr); /* 将图片分成3列 */ + grid-gap: 10px; /* 设置图片之间的间距 */ + justify-items: center; /* 居中显示图片 */ }} .image img {{ - max-width: 33vw; - max-height: 33vh; + width: 100%; /* 图片宽度100%填充父容器 */ + height: auto; /* 固定高度150px */ + object-fit: cover; /* 保持比例裁剪图片 */ + max-width: 33vw; /* 限制图片的最大宽度 */ + max-height: 33vh; /* 限制图片的最大高度 */ border-radius: 10px; cursor: pointer; - }} + }} .comments {{ margin-top: 5px; /* 调整这里的值来减少间距 */ background-color: #444;