Add a font to a website

巧了我就是萌 提交于 2019-12-01 02:00:20

Not all browser support .ttf. Use a font generator to get all the font types ( I use font2web ) and then just add the fonts via @font-face:

@font-face {
    font-family: 'fontName';
    src: url('../fonts/fontName.eot');
    src: url('../fonts/fontName.eot?iefix') format('eot'),
         url('../fonts/fontName.woff') format('woff'),
         url('../fonts/fontName.ttf') format('truetype'),
         url('../fonts/fontName.svg#fontName') format('svg');
    font-weight: normal;
    font-style: normal;
 }

Read here about browser font support.

You can try this website for your web font generation. If your font exists, you can convert it and get all the @font-face parameters to apply it for your website.

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