将字体添加到网站
问题描述:
我正在尝试添加这种字体: 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;
}
在这里阅读浏览器字体支持。