How to add some non-standard font to Html?

早过忘川 提交于 2019-12-11 07:25:24

问题


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> 

回答1:


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.




回答2:


use Font Squirrel generator. But beware of the font license!



来源:https://stackoverflow.com/questions/44609197/how-to-add-some-non-standard-font-to-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!