# 「求助」如何修改CSS调整字体大小（wnwcd5）

**URL:** <https://forum.freemdict.com/t/topic/34399>\
**Category:** 技术交流与词典编修\
**Created:** [2024 年11 月 28 日 12:10 UTC](https://forum.freemdict.com/t/topic/34399 "2024-11-28T12:10:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

作者： ![scottsvrain](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/scottsvrain/32/788_2.png) [@scottsvrain](https://forum.freemdict.com/u/scottsvrain)\
发布日期： [2024 年11 月 28 日 12:10 UTC](https://forum.freemdict.com/t/topic/34399/1 "2024-11-28T12:10:06Z")

</div>

[wnwcd5.css](https://forum.freemdict.com/uploads/short-url/8XPefyRFzNMJ7BbmMi3MKYHtLKy.css) (6.4 KB)  
来源

> [@WNWCD 5th 简妆](https://forum.freemdict.com/t/topic/3788):
>
> WNWCD 5th 简单改了色彩、自用（高贵低调 grinning）。 ★ 克莱因蓝 wink // 用途很简单。或者修改 mdx，或者引入此 js setTimeout(function(){ var i, l, item, htys …

我添加了  
.sense {  
font-size: 1.1rem; /\* 统一调整解释部分字体 \*/  
}  
主项解释字体变大了，但是缩进的子项字体大小没有变化

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/1/c/1cdf9539994c211c90084aada7dc782b19397071.png)

 ![HapiGo 2024-11-28 12-10-48](https://forumcdn.freemdict.com/uploads/default/original/3X/e/6/e6d373821ba3176beba5f7da3ae2e668bd3d3a2f.png)

---

<div class="post-metadata">

作者： ![shaoshi](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shaoshi/32/14529_2.png) [@shaoshi](https://forum.freemdict.com/u/shaoshi)\
发布日期： [2024 年11 月 28 日 12:12 UTC](https://forum.freemdict.com/t/topic/34399/2 "2024-11-28T12:12:12Z")

</div>

> [@scottsvrain](#):
>
> font-size: 1.1rem

是1.1em，不是1.1rem

---

<div class="post-metadata">

作者： ![scottsvrain](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/scottsvrain/32/788_2.png) [@scottsvrain](https://forum.freemdict.com/u/scottsvrain)\
发布日期： [2024 年11 月 28 日 12:16 UTC](https://forum.freemdict.com/t/topic/34399/3 "2024-11-28T12:16:49Z")

</div>

确实是rem，源文件就是这么写的

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/7/4/744f531810d1cc6824cc9fe9b42be72b3a184b9c.png)

---

<div class="post-metadata">

作者： ![shaoshi](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shaoshi/32/14529_2.png) [@shaoshi](https://forum.freemdict.com/u/shaoshi)\
发布日期： [2024 年11 月 28 日 12:20 UTC](https://forum.freemdict.com/t/topic/34399/4 "2024-11-28T12:20:20Z")

</div>

呃，我只用过em，没用过rem。那我就不知道了。

---

<div class="post-metadata">

作者： ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
发布日期： [2024 年11 月 28 日 12:24 UTC](https://forum.freemdict.com/t/topic/34399/5 "2024-11-28T12:24:30Z")

</div>

这个注释有问题，rem 不能调整子项的字体，需要使用 em 单位，子项的样式也需要改动。

> [@scottsvrain](#):
>
> /\* 统一调整解释部分字体 \*/

---

<div class="post-metadata">

作者： ![jcz777](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/jcz777/32/60576_2.png) [@jcz777](https://forum.freemdict.com/u/jcz777)\
发布日期： [2024 年11 月 28 日 12:46 UTC](https://forum.freemdict.com/t/topic/34399/6 "2024-11-28T12:46:08Z")

</div>

em只继承上级字体大小。  
rem继承 根元素属性 ，需要根据 根元素 定义大小进行计算。如果根级没有定义，1rem一般是12px，后面多少rem均要乘以12px。3rem就是`3*12px`。但如果 根元素 定义为16px，那么3rem就是`3*16px`。

---

<div class="post-metadata">

作者： ![scottsvrain](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/scottsvrain/32/788_2.png) [@scottsvrain](https://forum.freemdict.com/u/scottsvrain)\
发布日期： [2024 年11 月 28 日 13:13 UTC](https://forum.freemdict.com/t/topic/34399/7 "2024-11-28T13:13:55Z")

</div>

谢谢 但是应该怎么更改子项呢？

---

<div class="post-metadata">

作者： ![amob](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/amob/32/14630_2.png) [@amob](https://forum.freemdict.com/u/amob)\
发布日期： [2024 年11 月 28 日 14:56 UTC](https://forum.freemdict.com/t/topic/34399/8 "2024-11-28T14:56:10Z")

</div>

用rem也不是不行

---

<div class="post-metadata">

作者： ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
发布日期： [2024 年11 月 28 日 15:46 UTC](https://forum.freemdict.com/t/topic/34399/9 "2024-11-28T15:46:28Z")

</div>

把 sense 和其子项的字体单位都改成 em。
