网页字体没有得到应用! @字体面 [英] web font doesn't get applied! @font-face

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

问题描述



不幸的是,它没有得到应用,我离开了我的网页字体,我正在使用DejavuSans显示格鲁吉亚ქართული文本。想法。

  @ font-face {
font-family:'DejaVuSans';
src:url('font / DejaVuSans.eot');
src:url('font / DejaVuSans.eot?#iefix')格式('embedded-opentype'),
url('font / DejaVuSans.woff')格式('woff'),
url('font / DejaVuSans.ttf')格式('truetype'),
url('font / DejaVuSans.svg#bolnisiregular')format('svg');
font-weight:normal;
font-style:normal;
}

body
{
font-family:'DejaVuSans'!important;
}

我从这里下载: http://www.fonts2u.com/dejavu-sans.font



我在这里应用: http://mac.idev.ge:800/breakmedia/



Chrome检查器告诉我,css被正确覆盖,但字体本身在哪里?

解决方案

网址是相对于包含css文件的文件夹。所以你的网址字体需要是绝对的,并指向根例如:

  /font/DejaVuSans.eot 

或相对并指向一个文件夹:

 ../ font / DejaVuSans.eot 

你的样式表和字体都在。


I'm struggling with web fonts, I'm using DejavuSans to display Georgia ქართული text.

Unfortunately it doesn't get applied and I'm out of ideas.

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

body
{
   font-family: 'DejaVuSans' !important;
}

I downloaded it from here: http://www.fonts2u.com/dejavu-sans.font

And I applied it here: http://mac.idev.ge:800/breakmedia/

Chrome inspector tells me that css is correctly overwritten, but where are the fonts themselves??

解决方案

Urls are relative to the folder containing the css file. So your url to the font needs to be absolute and point to the root e.g:

/font/DejaVuSans.eot

or relative and point to one folder up:

../font/DejaVuSans.eot

etc depending on where your stylesheet and fonts are located.

这篇关于网页字体没有得到应用! @字体面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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