0
这是这样一个noob问题,但在这里不用...浏览器在全部被称为Roboto时如何知道我想使用的字体?
我加载从本地服务器字体时使用下面的造型看到了很多例子:
@font-face {
font-family: "Roboto";
src: local(Roboto Thin),
url("#{$roboto-font-path}Roboto-Thin.woff2") format("woff2"),
url("#{$roboto-font-path}Roboto-Thin.woff") format("woff");
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: local(Roboto Medium),
url("#{$roboto-font-path}Roboto-Light.woff2") format("woff2"),
url("#{$roboto-font-path}Roboto-Light.woff") format("woff");
font-weight: 500;
font-style: normal;
注意,font-family
两被称为Roboto。
如何在我的造型中让我的浏览器知道我想要使用Thin还是Medium字体?
在其他项目中,我从外部页面加载字体时使用了font-family: "Roboto Light"
。
啊!一个永远不会老去学习:-)谢谢。 – Steven