为什么我不能嵌入字体?
索引.php
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Some Title</title>
<link href='img/fav.png' rel='icon'>
<link href="index.css" rel="stylesheet">
</head>
<body>
<div id="logo01">Some Text</div>
</body>
</html>
索引.css
@font-face {
font-family: harrington-normal;
src: url("harrington-normal.otf") format("opentype");
}
#logo01{
font-family:harrington-normal;
font-size:5.9rem;
color:#ffffff;
}
#logo01
不是哈灵顿字体!
index.php
, index.css
和 harrington-normal.otf
都在根文件夹中。
我正在使用 Chrome。
控制台显示:GET http://localhost/stenaljubavi.net16.net/up/harrington-normal.otf .....index.php:325
查看页面源代码 - 第 325 行是:
<script src="jquery-2.1.4.min.js"></script>
有什么想法吗?
最佳答案
如果无法访问这些文件,很难在这里为您提供帮助,但一般来说,OTF 本身并不是处理网络字体的最佳方式。在这里阅读 https://css-tricks.com/snippets/css/using-font-face/
关于css - 嵌入开放式字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33702990/