【发布时间】:2015-12-25 11:13:57
【问题描述】:
我在我的网站中使用了许多网络字体,现在我想添加具有 serif/sans-serif/monospace 字体类型的新字体系列。 我的 CSS 的一部分:
@font-face {
font-family: 'DejaVu', sans-serif;
font-weight: 400;
font-style: normal;
src: url(dejavu/DejaVuSans.ttf)
}
@font-face {
font-family: 'DejaVu', monospace;
font-weight: 400;
font-style: normal;
src: url(dejavu/DejaVuSansMono.ttf);
}
@font-face {
font-family: 'DejaVu', serif;
font-weight: 400;
font-style: normal;
src: url(dejavu/DejaVuSerif.ttf);
}
但它不起作用(在 css 控制台中,我看到如下错误:font-family 的值错误)。 有没有办法让它只使用一个字体名称。
我知道我可以将字体系列名称更改为:“DejaVu Serif”,但我不想这样做。
【问题讨论】: