【发布时间】:2015-10-04 22:06:50
【问题描述】:
我决定更改页面的字体,并从互联网上下载另一个。我试过这种方式,但它不起作用。文件“font.ttf”与 html 文件位于同一文件夹中。
@font-face {
font-family: Test;
src: url(font.ttf);
}
header {
font-family: Test;
width: 100%;
margin: auto;
height: 48px;
background-color: white;
}
【问题讨论】:
-
查看 webdeveloper 工具中的控制台或网络选项卡。字体是否加载成功?
-
确保路径正确。 @font-face { 字体系列:测试; src: url(../font.ttf); }