From 0a27cacf20588ea51eb891c421437d50c41cbe73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B5=B5=E5=90=8C=E5=AD=A6?= <94612053+imzql@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:03:22 +0800 Subject: [PATCH] 9.16 --- public/css/main.css | 21 +++++++++++++++++++-- themes/Ying/static/css/main.css | 21 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index debab539..91c9ffa3 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -2084,14 +2084,31 @@ img[atk-emoticon] { } } -/* 马克笔效果 */ +#post-writing p{ + margin-bottom: 10px; +} + +#post-writing h2 { + position: relative; /* 确保伪元素的定位相对于 h2 元素 */ + display: inline-block; /* 使 h2 的宽度适应内容 */ + margin-top: 5px; + margin-bottom: 0px; +} + +#post-writing h2:nth-child(1) { + position: relative; /* 确保伪元素的定位相对于 h2 元素 */ + display: inline-block; /* 使 h2 的宽度适应内容 */ + margin-top: 13px; + margin-bottom: 0px; +} + #post-writing h2::before { content: ""; position: absolute; height: 7px; bottom: 0px; left: -1px; - width: 15%; + width: 100%; /* 使用 100% 使伪元素宽度跟随文字 */ z-index: -1; background-color: #494949; opacity: 0.15; diff --git a/themes/Ying/static/css/main.css b/themes/Ying/static/css/main.css index debab539..91c9ffa3 100644 --- a/themes/Ying/static/css/main.css +++ b/themes/Ying/static/css/main.css @@ -2084,14 +2084,31 @@ img[atk-emoticon] { } } -/* 马克笔效果 */ +#post-writing p{ + margin-bottom: 10px; +} + +#post-writing h2 { + position: relative; /* 确保伪元素的定位相对于 h2 元素 */ + display: inline-block; /* 使 h2 的宽度适应内容 */ + margin-top: 5px; + margin-bottom: 0px; +} + +#post-writing h2:nth-child(1) { + position: relative; /* 确保伪元素的定位相对于 h2 元素 */ + display: inline-block; /* 使 h2 的宽度适应内容 */ + margin-top: 13px; + margin-bottom: 0px; +} + #post-writing h2::before { content: ""; position: absolute; height: 7px; bottom: 0px; left: -1px; - width: 15%; + width: 100%; /* 使用 100% 使伪元素宽度跟随文字 */ z-index: -1; background-color: #494949; opacity: 0.15;