gpt4 book ai didi

css - 如何在本地服务器(xampp)上使用字体?

转载 作者:行者123 更新时间:2023-11-28 07:41:53 25 4
gpt4 key购买 nike

我正在尝试使用 font-face 和计算机上的本地字体自定义字体。

我在本地服务器上使用 XAMPP,在 IDE 上使用 Dreamweaver(不确定这是否重要,尽管我在那里“管理”了我的字体并添加了我尝试使用的字体)。

无论如何,当我试图查看我的测试时,我不断从浏览器控制台收到以下“错误”:我正在尝试这个东西的 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>

最佳答案

我很确定您也需要 origami_making.eot,并使用相对 URL。例子

@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;
}

关于css - 如何在本地服务器(xampp)上使用字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30909182/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com