gpt4 book ai didi

css - 字重

转载 作者:行者123 更新时间:2023-11-28 09:14:04 27 4
gpt4 key购买 nike

我正在使用购买字体 (Museo Sans) 作为我正在开发的应用程序中的自定义字体。当我购买它时给我的文件包含不同重量的网络字体文件:MuseoSans100Regular、MuseoSans300Regular 等。@font-face 中有没有办法指定用于不同重量的文件,以便我可以这样做:

font-family: MuseoSans;
font-weight: 300;

而不是这个:

font-family: MuseoSans300;

最佳答案

是的,您必须在两个不同的 @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*/
}

关于css - 字重,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12462407/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com