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;