首页 > 解决方案 > 为什么我的网站上的自定义字体不起作用

问题描述

在我添加对 .ttf、.eot 和 .svg 的支持之前,它可以工作,但现在,它不再工作了。

CSS:

@charset "UTF-8";
@font-face {
    font-family: 'qianxsnjgregular';
    src: url('./font/zh/qxsn-webfont.eot');
    src: url('./font/zh/qxsn-webfont.eot?#iefix') format('embedded-opentype'),
         url('./font/zh/qxsn-webfont.woff2') format('woff2'),
         url('./font/zh/qxsn-webfont.woff') format('woff'),
         url('./font/zh/qxsn-webfont.ttf') format('truetype'),
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
body {
    font-family: 'qianxsnjgregular', SimHei, sans-serif;
    font-weight:normal;
    font-style:normal;
}

标签: css

解决方案


推荐阅读