Closed GD2021 closed 10 months ago
您好,目前主题不支持修改全局字体。 如果有条件可以自己下载源码,修改css代码,编译后使用。 或者这个情况如果需求比较大的话,我可以更新使字体可以通过配置自定义。
您可以先提供想要替换的字体,我考虑一下~
如何修改全局的字体呢?
也可以在 Halo 后台 -> 设置 -> 代码注入 -> 全局
自行植入 CSS
以下是一个示例, 可以根据自己的需求自行修改!
<!--引入字体-->
<link rel="stylesheet" href="https://npm.elemecdn.com/lxgw-wenkai-webfont@1.1.0/lxgwwenkai-regular.css" />
<style>
/*全局字体*/
* {
font-family: LXGW WenKai;
font-weight: bold;
}
</style>
感谢!!
为何标题不生效呢?
为何标题不生效呢?
可以提供站点我看一下么
<!-- 引入字体 -->
<link rel="stylesheet" href="https://npm.elemecdn.com/lxgw-wenkai-webfont@1.1.0/lxgwwenkai-regular.css" />
<style>
/* 全局字体 */
* {
font-family: 'LXGW WenKai', sans-serif;
}
/* 标题字体 */
h1, h2, h3, h4, h5, h6 {
font-family: 'LXGW WenKai', sans-serif;
font-weight: bold; /* 为标题设置加粗 */
}
</style>
修改了一下,好了。
如何修改全局的字体呢?
见:https://github.com/AirboZH/halo-theme-chirpy/issues/127#issuecomment-1832987582