我知道我可以通过html / css导入我的字体,但我想知道这是否可行。
发布于 2018-04-25 13:43:28
你仍然需要@font-face
在CSS中使用规则引用字体,以便在页面中使用它们。例如,在你的manifest文件中:
CACHE MANIFEST
# v1
index.html
style.css
GenBasR-webfont.eot
GenBasR-webfont.woff
GenBasR-webfont.ttf
GenBasR-webfont.svg
在style.css中:
@font-face {
font-family: 'GentiumBasicRegular';
src: url('GenBasR-webfont.eot');
src: url('GenBasR-webfont.eot?iefix') format('eot'),
url('GenBasR-webfont.woff') format('woff'),
url('GenBasR-webfont.ttf') format('truetype'),
url('GenBasR-webfont.svg#webfontLblSsz1O') format('svg');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'GentiumBasicRegular';
}
https://stackoverflow.com/questions/-100003308
复制相似问题