【发布时间】:2021-01-04 12:20:19
【问题描述】:
最近,我重新开始编写代码,并想通过做一个小网站来练习。所以,我想用@font-face 来定义一个自定义字体,而且我知道应该这样做(我的字体叫做 Champagne & limousines):
<style>
@font-face {
font-family: 'Champagne & Limousines';
src: url('/fonts/Champagne & Limousines.eot');
src: url('/fonts/Champagne & Limousines.woff2') format('woff2'),
url('/fonts/Champagne & Limousines.woff') format('woff'),
url('/fonts/Champagne & Limousines.ttf') format('truetype'),
url('/fonts/Champagne & Limousines.svg#Champagne & Limousines') format('svg'),
url('/fonts/Champagne & Limousines.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
不过,我想知道为什么我们不必在每行之前加上“src:”。有人能教我这背后的逻辑吗?
谢谢。
【问题讨论】: