我不确定如何正确地显示具有3种字重的字体 - `normal`,`bold`和`lighter` - 但是,在大多数浏览器中似乎有效,除了Firefox。
Firefox似乎使用`font-weight: lighter`作为默认值?
我想要的是在Chrome中的字体外观。
@font-face {
font-family: 'lovelo';
src: url('../fonts/lovelo.eot');
src: url('../fonts/lovelo.eot?#iefix') format('embedded-opentype'),
url('../fonts/lovelo.woff') format('woff'),
url('../fonts/lovelo.ttf') format('truetype'),
url('../fonts/lovelo.svg#loveloblack') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'lovelo';
src: url('../fonts/lovelo-bold.eot');
src: url('../fonts/lovelo-bold.eot?#iefix') format('embedded-opentype'),
url('../fonts/lovelo-bold.woff') format('woff'),
url('../fonts/lovelo-bold.ttf') format('truetype'),
url('../fonts/lovelo-bold.svg#loveloblack') format('svg');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'lovelo';
src: url('../fonts/lovelo-light.eot');
src: url('../fonts/lovelo-light.eot?#iefix') format('embedded-opentype'),
url('../fonts/lovelo-light.woff') format('woff'),
url('../fonts/lovelo-light.ttf') format('truetype'),
url('../fonts/lovelo-light.svg#loveloblack') format('svg');
font-weight: lighter;
font-style: normal;
}
lighter
不是@font-face
规则中font-weight
的有效值。请参阅 http://dev.w3.org/csswg/css-fonts/#descdef-font-weight 查看规范。 - Boris Zbarsky