html - 我的浏览器无法正确显示此字体
问题描述
我想在 Google 协作平台中使用此代码来使用我的字体。为什么这不起作用?我的浏览器将其显示为 Times New Roman。
@font-face {font-family: Johnston ITC; src: url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');}
h1 {
font-family: Johnston_ITC
}
<h1>Hey, June</h1>
一些建议?
解决方案
尝试这个:
font-family: 'Johnston_ITC', sans-serif;