为什么我不能实现@ font-face?(Why Can I Not Implement @font-face?)

其他开发 IT屋
问 题

My problem is that custom fonts do not display when using @font-face.

My CSS is referenced in it's own file and the code is:

@font-face {
    font-family: 'MerceariaAntique';
    src: url('type/mercearia_new/21319b_0_0-mercearia.eot');
    src: url('type/mercearia_new/21319b_0_0-mercearia.eot?#iefix') format('embedded-    opentype'),
         url('type/mercearia_new/21319b_0_0-mercearia.woff') format('woff'),
         url('type/mercearia_new/21319b_0_0-mercearia.ttf') format('truetype'),
         url('type/mercearia_new/21319b_0_0-mercearia.svg#webfontuploaded_file')     format('svg');
    font-weight: normal;
    font-style: normal;
    }

In my HTML file I have referenced it as the following alongside the main CSS file:

<link rel="stylesheet" type="text/css" media="all" href="css/fonts.css" />

I suspect I have referenced it incorrectly, but I can't find out how to reference it correctly.

解决方案

what is your folder structure?? if you calling css inside a folder "css" you must point out the correct path to custom fonts like this "../"

src: url('../type/mercearia_new/21319b_0_0-mercearia.eot');

本文地址:IT屋 » Why Can I Not Implement @font-face?

问 题

我的问题是当使用 @ font-face 时,自定义字体不显示。



我的CSS是引用它自己的文件和代码是:

  @ font-face {
font-family:'MerceariaAntique' ;
src:url('type / mercearia_new / 21319b_0_0-mercearia.eot');
src:url('type / mercearia_new / 21319b_0_0-mercearia.eot?#iefix')format('embedded- opentype'),
url('type / mercearia_new / 21319b_0_0-mercearia.woff')格式('woff'),
url('type / mercearia_new / 21319b_0_0-mercearia.ttf')格式('truetype'),
url('type / mercearia_new / 21319b_0_0-mercearia.svg#webfontuploaded_file ')格式('svg');
font-weight:normal;
font-style:normal;



$ b

在我的HTML文件中,我将它引用为主CSS文件:



 < link rel =“stylesheet”type =“text / css”media =“all”href =“css / fonts.css“/> 


我怀疑我的引用不正确,但是我找不到如何正确引用它。

解决方案

您的文件夹结构如何?
如果你在一个文件夹“css”中调用css,你必须指出正确的路径到自定义字体
像这样“../\"



  src:url('../ type / mercearia_new / 21319b_0_0-mercearia.eot'); 

本文地址:IT屋 » 为什么我不能实现@ font-face?