Html 我的浏览器无法正确显示此字体
我想用这段代码在谷歌网站上使用我的字体。为什么这不起作用?我的浏览器将其显示为Times New RomanHtml 我的浏览器无法正确显示此字体,html,css,Html,Css,我想用这段代码在谷歌网站上使用我的字体。为什么这不起作用?我的浏览器将其显示为Times New Roman @font-face{font-family:Johnston-ITC;src:url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');} h1{ 字体系列:约翰斯顿大学国际贸易中心 } 嘿,June试试这个: font-family: 'Johnston_ITC', sans-serif;
@font-face{font-family:Johnston-ITC;src:url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');}
h1{
字体系列:约翰斯顿大学国际贸易中心
}
嘿,June
试试这个:
font-family: 'Johnston_ITC', sans-serif;
您的代码中有错误。试试这个:
@font-face {font-family: "Johnston ITC"; src: url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');}
h1 { font-family: "Johnston ITC" }
您正在调用字体“Johnston_ITC”,并已将其声明为“Johnston ITC”。
你还忘了引用的话
给你。此src工作正常
<html>
<head>
<style>
@font-face {font-family: "Johnston ITC";
src: url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.eot");
src: url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.eot?#iefix") format("embedded-opentype"),
url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.woff2") format("woff2"),
url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.woff") format("woff"),
url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.ttf") format("truetype"),
url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.svg#Johnston ITC Std") format("svg");
}
h1 {
font-family: "Johnston ITC"
}
</style>
</head>
<body>
<h1>Hey, June</h1>
</body>
</html>
@字体{字体系列:“约翰斯顿国际贸易中心”;
src:url(“//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e04e03920bdf36d.eot”);
src:url(//db.onlinewebfonts.com/t/9E4EE8BD2B9E501B34E033920BDF36D.eot?#iefix)格式(“嵌入式opentype”),
url(“//db.onlinewebfonts.com/t/9E4EE8BD2B9E501B34E033920BDF36D.woff2”)格式(“woff2”),
url(“//db.onlinewebfonts.com/t/9E4EE8BD2B9E501B34E033920BDF36D.woff”)格式(“woff”),
url(“//db.onlinewebfonts.com/t/9E4EE8BD2B9E501B34E033920BDF36D.ttf”)格式(“truetype”),
url(//db.onlinewebfonts.com/t/9E4EE8BD2B9E501B34E033920BDF36D.svg#约翰斯顿ITC标准)格式(“svg”);
}
h1{
字体系列:“约翰斯顿ITC”
}
嗨,琼
显示