方案A(只放大“分类页/列表页”的文章摘要/正文块)
好,这个问题非常典型,而且很好修 👍 现在的情况是:正文放大了,但规则“波及”到了标题和侧边栏。我们要做的是——
只放大「文章正文内容」 明确压回:文章标题 + 侧边栏字体
下面我给你一套**“精准收敛版 CSS”**,一步到位。
一、先「压回」文章标题大小(很关键)
Novo 的文章标题一般在 .post-title 或 .site-content h1/h2 里,我们直接单独控制:
/* === 修正文章标题大小(不要跟着正文一起变大) === */
.post.type-post h1,
.post.type-post h2,
.post.type-post .post-title {
font-size: 28px !important;
line-height: 1.4 !important;
}
如果你觉得 28px 还是大,可以改成 26px。
二、只放大「正文内容」,不碰标题
这是核心规则👇 我们只命中你 HTML 里真实存在的这个结构:
<div class="post-content">
<p>正文</p>
</div>
对应 CSS:
/* === 文章页:只放大正文,不影响标题 === */
.post.type-post .post-content p,
.post.type-post .post-content li {
font-size: 18px !important;
line-height: 1.9 !important;
}
⚠️ 注意: 这里没有写 .post-content 本身,只写 p / li,这是避免标题、块元素一起被放大。
三、把侧边栏字体「压回正常大小」
Novo 的侧边栏一般是 .sidebar、.widget、.widget-title 这一套:
/* === 侧边栏字体恢复正常 === */
.sidebar,
.sidebar p,
.sidebar li {
font-size: 14px !important;
line-height: 1.6 !important;
}
.sidebar .widget-title {
font-size: 16px !important;
}
如果你觉得侧边栏略小,可以把 14px 改成 15px。
四、最终【推荐完整版本】一次性粘贴
👉 外观 → 自定义 → 额外 CSS 👉 把下面这整段粘进去(覆盖之前的):
/* ===============================
Novo:文章页字体精确控制
=============================== */
/* 1️⃣ 文章标题(压回) */
.post.type-post h1,
.post.type-post h2,
.post.type-post .post-title {
font-size: 28px !important;
line-height: 1.4 !important;
}
/* 2️⃣ 正文内容(只放大段落和列表) */
.post.type-post .post-content p,
.post.type-post .post-content li {
font-size: 18px !important;
line-height: 1.9 !important;
}
/* 3️⃣ 侧边栏恢复正常 */
.sidebar,
.sidebar p,
.sidebar li {
font-size: 14px !important;
line-height: 1.6 !important;
}
.sidebar .widget-title {
font-size: 16px !important;
}
