Html @Universe 55字体的字体面规则无效

Html @Universe 55字体的字体面规则无效,html,css,font-face,truetype,Html,Css,Font Face,Truetype,在html5中,我使用了自定义字体(Universe 55字体)。我下载了.ttf文件,与@font-face规则一起使用,并与IE、Chrome和移动浏览器一起检查。它不起作用,但在网站上,他们说浏览器将支持这种字体类型。 字体是否需要使用其他文件格式 我使用@font-face规则作为 @font-face { font-family: 'Universe2'; src: url("C:\Users\..\Desktop\Fonts\Univers LT 55 Roman.ttf"); }

在html5中,我使用了自定义字体(Universe 55字体)。我下载了.ttf文件,与@font-face规则一起使用,并与IE、Chrome和移动浏览器一起检查。它不起作用,但在网站上,他们说浏览器将支持这种字体类型。 字体是否需要使用其他文件格式

我使用@font-face规则作为

@font-face
{ font-family: 'Universe2';
src: url("C:\Users\..\Desktop\Fonts\Univers LT 55 Roman.ttf"); }
.custfont
{ font-family: 'Universe2';
font-size:25px; }
<body><div class='custfont'>This is a customized font</div></body>
@font-face
{字体系列:“Universe2”;
src:url(“C:\Users\..\Desktop\font\Univers LT 55 Roman.ttf”);}
.custfont
{字体系列:“Universe2”;
字体大小:25px;}
这是一种定制字体

在您的项目中添加univ LT 55 Roman.ttf…

您必须通过项目链接它,例如您的项目位于d:/projectname中,您有字体文件,您在CSS中链接它如下:

@font-face {
    font-family: 'MyFont';
    src: url('myfont.eot'); /* IE9 Compat Modes */
    src: url('myfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('myfont.woff') format('woff'), /* Modern Browsers */
         url('myfont.ttf')  format('truetype'), /* Safari, Android, iOS */
         url('myfont.svg#svgFontName') format('svg'); /* Legacy iOS */
    }

你应该从
C:\Users\..\Desktop
链接它吗?在添加了如何引用路径之后,我将html文件放在一个名为“myproj”的文件夹中。然后我使用src='C:\Users\..\Desktop\myproj\Univers LT 55 Roman.ttf''j添加了字体,只需给src:url('Univers LT 55 Roman.ttf')…无需为dat添加文件夹。。