网页设置字体

woodchen
2022-12-06 / 0 评论 / 6 阅读 / 正在检测是否收录...

外部文件字体

<style>
@font-face {
    font-family: 'CZL';
    src: url('https://*******/fonts/CZL.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
body, h1,h2,h3,h4,h5,h6,a,p,span,input,div,button,label,pre,select {
 font-family: "CZL",system-ui,-apple-system,"Microsoft YaHei",Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif
 }
 </style>

推荐用的,也是我自己用的样式,不引用外部字体,太慢了

html{
font-family:system-ui,-apple-system,"Microsoft YaHei",Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif
}

部分wordpress主题内置字体设置,还无法取消,这时候就需要更细致的设置字体,和添加important才能覆盖

body, h1,h2,h3,h4,h5,h6,a,p,span,input,div,button,label,pre,select{
font-family:system-ui,-apple-system,"Microsoft YaHei",Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif !important
}
0

评论 (0)

取消