Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Html中添加一些非标准字体?_Html_Css_Fonts_Hyperlink - Fatal编程技术网

如何在Html中添加一些非标准字体?

如何在Html中添加一些非标准字体?,html,css,fonts,hyperlink,Html,Css,Fonts,Hyperlink,所以我想在我的Html和CSS中添加一个自定义字体,但我很难将Html链接到我的字体 style type="text/css"> @font-face { font-family: "Uni Sans"; src: local(unisans) format("woff"); } p.unisans { font-family: "Uni Sans", Verdana, Tahoma; } </style> style type=“tex

所以我想在我的Html和CSS中添加一个自定义字体,但我很难将Html链接到我的字体

    style type="text/css">
@font-face {
    font-family: "Uni Sans";
    src: local(unisans) format("woff");
}
p.unisans { 
    font-family: "Uni Sans", Verdana, Tahoma;
}
</style> 
style type=“text/css”>
@字体{
字体系列:“unisans”;
src:本地(unisans)格式(“woff”);
}
p、 unisans{
字体系列:“Uni Sans”,Verdana,Tahoma;
}

使用。但是要小心字体许可证

无法将本地字体链接到html或CSS。您需要将想要的字体转换为webfont,如Fontsquirrel。下载并解压缩这些文件,将它们放入html页面的文件夹中,或者放入与html或CSS文件位于同一文件夹中的新“字体”文件夹中。然后打开从Fontsquirrel获得的stylesheet.css,将字体的css复制并粘贴到新的css文件中,并根据需要更改字体的路径。
然后在你需要的任何地方使用CSS中的字体“name”。

请详细说明实际结果和预期结果。我完成了所有步骤,但它仍然不起作用@font face{font family:'uni_sanssin_caps';src:url('/projekt/uni_sans_thin-webfont.woff2')格式('woff2')、url('/projekt/uni sans_thin-webfont.woff')格式('woff'));font-weight:normal;font-style:normal;}请添加CSS和html,或在线发送链接,以便我提供帮助?可能是您的路径不正确,或者它在本地不起作用,您必须将文件上载到ftp。我现在就知道了,问题是我没有将stylesheet.css链接到我的hmtl。非常感谢,这对我很有帮助。我很高兴你找到了bug:)