如何添加一些非标准的字体到Html? [英] How to add some non-standard font to Html?

查看:188
本文介绍了如何添加一些非标准的字体到Html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想添加一个自定义的字体到我的Html和CSS,但我努力链接Html我的字体。

  style type =text / css> 
@ font-face {
font-family:Uni Sans;
src:本地(unisans)格式(woff);
}
p.unisans {
font-family:Uni Sans,Verdana,Tahoma;
}
< / style>


解决方案

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


So i wanted to add a custom font to my Html and CSS but i'm struggling to link the Html my font.

    style type="text/css">
@font-face {
    font-family: "Uni Sans";
    src: local(unisans) format("woff");
}
p.unisans { 
    font-family: "Uni Sans", Verdana, Tahoma;
}
</style> 

解决方案

You cannot link a local font to your html or CSS. You need to convert the font you want to webfont, like Fontsquirrel. Download and unzip the files, place them into the folder of your html page or a new "fonts" folder located in the same folder as your html or CSS file. Then open the stylesheet.css that you get from Fontsquirrel, copy and paste the CSS of the font into your new css file and change the path of the font as you need. Then use the font 'name' in your CSS wherever you need.

这篇关于如何添加一些非标准的字体到Html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆