我正在使用购买字体(Museo Sans)作为我正在开发的应用程序中的自定义字体。当我购买它时给我的文件包含不同权重的web字体文件: MuseoSans100Regular,MuseoSans300Regular等。@ font -face中有没有一种方法来指定不同权重的文件,以便我可以这样做:
font-family: MuseoSans;
font-weight: 300;而不是这样:
font-family: MuseoSans300;发布于 2012-09-17 23:41:49
可以,您必须在两个不同的@font-face定义中指定哪个文件用于哪个font-weight:
@font-face {
font-family: 'MuseoSans';
src: url('../font/museo_sans_100.woff');
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: 'MuseoSans';
src: url('../font/museo_sans_300.woff');
font-weight: 300;
font-style: normal;
}
h1, p {
font-family: MuseoSans;
}
h1 {
font-weight: 300; /* uses museo_sans_300.woff */
}
p {
font-weight: 100; /* uses museo_sans_100.woff*/
}https://stackoverflow.com/questions/12462407
复制相似问题