2011-08-15 63 views
-1

这是我的代码。 我建立的@ font-face规则在这里:CSS @ font-face规则

@font-face { 
    font-family: 'ChunkFiveRegular'; 
    src: url('chunk-webfont.eot'); 
    src: url('file:///C:/.../Fonts/chunk-webfont.eot?#iefix') format('embedded-opentype'), 
     url('file:///C:/.../Fonts/chunk-webfont.woff') format('woff'), 
     url('file:///C:/.../Fonts/chunk.ttf') format('truetype'), 
     url('chunk-webfont.svg#ChunkFiveRegular') format('svg'); 
    font-weight: normal; 
    font-style: normal;} 

我分配到的元素在这里:

#main-navi{ 
    font-family:'ChunkFiveRegular';} 

而且我在这里把它的HTML:

<div id="main-navi" class="line"> 
    <ul class="line"> 
    <li> 
     <a href="#work">Work</a> 
    </li> 
    <li> 
     <a href="#play">Play</a> 
    </li> 
    </ul> 

但文字不显示ChunkFive字体。有谁知道我在这里做错了吗?

+2

URL路径看起来有点偏离,你确定他们是对的吗? – benhowdle89

+0

@ BoltClock - 为什么这是downvoted? – dopatraman

+0

你是否可能会用ul,li或属性中的另一种字体覆盖字体? – user1652993

回答

0

检查Firefox浏览器是否可以使用chrome中的firebug插件或开发人员工具(分别为f12和ctrl + shift + j)访问字体。

Theres很有可能是这样的文件:/ uri只是不能正常工作,considder使用相对URI来检查字体并检查url中的大小写。

css本身看起来很不错(右边是fontsquirrel?)。你可能想关闭那个div,但除此之外应该在理论上工作。

+0

@ sg3s - 我添加了一个相对网址,但它仍然不起作用 'src:url('Fonts/Chunkfive.otf')格式('opentype'),' 任何其他想法? – dopatraman