我尝试了很多方法和字体,但似乎仍然无法正常工作 CSS
@font-face {
font-family: 'veteran_typewriterregular';
src: url('veteran_typewriter-webfont-webfont.eot');
src: url('veteran_typewriter-webfont-webfont.eot?#iefix') format('embedded-opentype'),
url('veteran_typewriter-webfont-webfont.woff2') format('woff2'),
url('veteran_typewriter-webfont-webfont.woff') format('woff'),
url('veteran_typewriter-webfont-webfont.ttf') format('truetype'),
url('veteran_typewriter-webfont-webfont.svg#veteran_typewriterregular') format('svg');
font-weight: normal;
font-style: normal;
}
body{
font-family:veteran_typewriterregular, sans-sarif;
}
我为所有浏览器添加了所有字体类型和 url,并在一个空页面中单独使用它。仅使用 html 标准标签(、、、)。
最佳答案
您可以试试这个解决方案:
@import url('https://fonts.googleapis.com/css?family=McLaren&display=swap');
body{
font-family: 'McLaren', cursive;
}
<a> Hello, my name is Carla</a>
如果您想使用您的解决方案。首先将字体文件保存在元素的文件夹中。
关于html - font-face CSS 不出现在 HTML 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58733420/