为Typecho网站站点添加好看的字体

为Typecho网站站点添加好看的字体

TNT
TNT
2024-09-08 / 0 评论 / 4 阅读
在自定义CSS加入如下代码即可:
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap;
src:url(输入文件的链接) format('woff2')}
*{font-family:HarmonyOS_Sans_SC_Medium}
body {font-family: HarmonyOS!important;}
无自定义css的主题直接加载head文件
<style>
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap;
src:url(输入文件的链接) format('woff2')}
*{font-family:HarmonyOS_Sans_SC_Medium}
body {font-family: HarmonyOS!important;}
</style>
直接引用CDN
1,上传woff2文件到cdn托管,例如我的cdn.eees.cn/font目录
2,新建css文件命名为font.css
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap;
src:url(//cdn.eees.cn/font/jinbuti.woff2) format('woff2')}
*{font-family:HarmonyOS_Sans_SC_Medium}
body {font-family: HarmonyOS!important;}
3,在网页meta处引用此css
<link rel="stylesheet" href="//cdn.eees.cn/css/font.css"/>
0

评论 (0)

取消