简体   繁体   English

@Font-face不工作?

[英]@Font-face not working?

Im having trouble trying to get the font-face style working locally. 我在尝试让字体样式在本地工作时遇到了麻烦。 I know it should work locally as the folder I downloaded from font-squirrel renders correctly. 我知道它应该在本地工作,因为我从font-squirrel下载的文件夹正确呈现。

Ive copy and pasted everything exactly into the same folder structure supplied by fontsquirrel... 我已将所有内容复制并粘贴到fontsquirrel提供的相同文件夹结构中...

CSS CSS

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

#primary-navigation {font-family: 'URWClassicoItalic'; font-size:2em}

HTML HTML

<div id="primary-navigation">TEST</div>

My font files are all in the root, same directory as my index file. 我的字体文件都在根目录中,与我的索引文件相同。

Any help would be brilliant, thankyou 任何帮助都会很棒,谢谢

@font-face urls that are specified in a separate CSS file must have a url relative to this CSS 在单独的CSS文件中指定的@ font-face网址必须具有相对于此CSS的网址

for example: 例如:

src: url('../urw_classico_italic-webfont.eot');

if the CSS-file is one level above the folder, where the font-file is stored. 如果CSS文件比存储字体文件的文件夹高一级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM