将字体添加到网站 [英] Add a font to a website

查看:185
本文介绍了将字体添加到网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加这种字体: http://www.fonts2u。 com / vps-dong-da-hoa.font

I am trying to add this font : http://www.fonts2u.com/vps-dong-da-hoa.font

到我的网站。这是我的CSS:

to my website. Here is my CSS :

@font-face {
font-family: "VPSDODAH";
src: url(http://localhost/blablabla/wp-content/plugins/buddypress/bp-themes/frisco-for-buddypress/VPSDODAH.ttf) format("truetype");}

#header h1 a {
font-family: "VPSDODAH";}

字体的URL是正确的,但它不工作,它可以是什么?

The URL to the font is correct but it's not working, what can it be ?

非常感谢。

推荐答案

并非所有的浏览器都支持 .ttf 。使用字体生成器来获取所有的字体类型(我使用 font2web ),然后通过 @ font-face

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;
 }

在这里阅读浏览器字体支持

这篇关于将字体添加到网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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