嵌入开放式字体

时间:2015-11-13 22:47:35

标签: css fonts

为什么我不能嵌入字体?

的index.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>

index.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.phpindex.cssharrington-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>

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

在没有访问文件的情况下很难帮助你,但一般来说OTF本身并不是最好的网络字体。请在此处阅读https://css-tricks.com/snippets/css/using-font-face/

相关问题