我正在尝试使用字体脸的自定义字体和我电脑上的本地字体。
我使用XAMPP作为本地服务器和Dreamweaver作为IDE (不确定这很重要,尽管我在那里“管理”了我的字体,并添加了我试图使用的字体)。
无论如何,当我试图查看我的测试时,我总是从浏览器控制台获得以下“错误”:“”,用于我正在试用的h1元素上的字体系列。
这是我做过的一些代码,也许我做错了什么?
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Prueba: Importando Fuentes</title>
<style type="text/css">
@font-face
{
font-family: 'origami';
src:url("http://localhost/Laboratorio%20de%20Pruebas/Mayo/Fonts/fonts/fonts/origami_making.ttf");
font-weight:normal;
}
h1
{
font-familiy: 'origami', sans-serif;
}
h2
{
font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
}
</style>
</head>
<body>
<h1>ORIGAMI</h1>
<h2>IMPACT</h2>
</body>
</html>发布于 2015-06-18 07:40:50
我很确定您也需要origami_making.eot,并使用相对urls。示例
@font-face {
font-family: "Flaticon";
src: url("flaticon.eot");
src: url("flaticon.eot#iefix") format("embedded-opentype"),
url("flaticon.woff") format("woff"),
url("flaticon.ttf") format("truetype"),
url("flaticon.svg") format("svg");
font-weight: normal;
font-style: normal;
}https://stackoverflow.com/questions/30909182
复制相似问题