在HTML中使用@font-face

在HTML中使用@font-face,html,css,logic,font-face,Html,Css,Logic,Font Face,最近,我又回到了代码中,想通过做一个小网站来练习。所以,我想用@font-face定义一种自定义字体,我知道应该这样做(我的字体叫香槟和豪华轿车): @字体{ 字体系列:“香槟和豪华轿车”; src:url('/fonts/champing&Limousines.eot'); src:url('/fonts/champing&Limousines.woff2')格式('woff2'), url('/fonts/champane&Limousines.woff')格式('woff'), url(

最近,我又回到了代码中,想通过做一个小网站来练习。所以,我想用@font-face定义一种自定义字体,我知道应该这样做(我的字体叫香槟和豪华轿车):


@字体{
字体系列:“香槟和豪华轿车”;
src:url('/fonts/champing&Limousines.eot');
src:url('/fonts/champing&Limousines.woff2')格式('woff2'),
url('/fonts/champane&Limousines.woff')格式('woff'),
url('/fonts/champane&Limousines.ttf')格式('truetype'),
url('/fonts/champane&Limousines.svg#champane&Limousines')格式('svg'),
url('/fonts/CHAMPANE&LIMOUSES.eot?#iefix')格式('embedded-opentype');
字体大小:正常;
字体风格:普通;
}
不过,我想知道为什么我们不必在每行前面加上“src:”。有谁能教我这背后的逻辑吗


谢谢。

在html中使用字体,您应该在您想要的某些部分使用,例如,如果我想使用的话 “Vazir Fd”(这是我所在国家的常用字体),我是这样使用的:

@font-face{
font-family:'Vazir-FD',

  `src:url('/path')`
 }


body{
font-family:'Vazir-FD'
}

在本例中,我将其插入正文中,您可以在任何地方输入您的字体系列。

在html中使用字体时,您应该在您想要的特定部分使用,例如,如果我想使用的话 “Vazir Fd”(这是我所在国家的常用字体),我是这样使用的:

@font-face{
font-family:'Vazir-FD',

  `src:url('/path')`
 }


body{
font-family:'Vazir-FD'
}
在本例中,我将其插入body中,您可以在任意位置输入字体族