我正在使用购买字体 (Museo Sans) 作为我正在开发的应用程序中的自定义字体。我购买时给我的文件包含不同粗细的网络字体文件:MuseoSans100Regular、MuseoSans300Regular 等。@font-face 中有没有办法指定用于不同粗细的文件,以便我可以执行此操作:
font-family: MuseoSans;
font-weight: 300;
而不是这个:
font-family: MuseoSans300;
是的,您必须指定哪个文件适用于哪个font-weight
在两个不同的@font-face
定义:
@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*/
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)