IE中的@ font-face问题 [英] @font-face issues in IE

查看:158
本文介绍了IE中的@ font-face问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在我的投资组合网站上使用@ font-face,在Chrome,Firefox和Safari中一切正常 - 但IE证明是个问题。

So I'm using @font-face for my portfolio website, and all is OK in Chrome, Firefox and Safari - but IE is proving a problem.

以下是我的CSS文件;

The following is in my CSS file;

@font-face {
font-family:"League"
src: url('sources/League_Gothic.otf')format('opentype');
}

然后对于IE,我在主HTML页面上有以下内容。

And then for IE, I have the following on the main HTML page.

<!--[if IE]>

<style type="text/css" media="screen">

@font-face{
    font-family:'League';
    src: url('sources/league_gothic-webfont.eot');
}

</style>

<![endif]-->  

我在Font Squirrel上的.oft文件中创建了.eot文件,但IE继续使用默认的Times New Roman。

I created the .eot file from the .oft file on Font Squirrel, but IE continues to just use the default Times New Roman.

有任何建议吗?

PS。我的网站位于iamturner.co.uk

PS. My site is at iamturner.co.uk

推荐答案

Fontsquirrel提供font-face package下载,其中不仅包含各种字体本身,还有一个CSS样式表,可以将它们放在您的页面上。查看生成的样式表;它不适合生产使用,但它确实适用于您提到的所有浏览器,您可以将它用作自己的样式表的基础。 (这一次,条件评论不需要BTW)。

Fontsquirrel offers a "font-face package" download, which contains not only the various fonts themselves, but also a CSS stylesheet to put them on your page. Look at the generated stylesheet; it's not perfect for production use, but it does work in all the browsers you mention, and you can use it as a basis for your own stylesheets. (This once, conditional comments aren't needed BTW).

这篇关于IE中的@ font-face问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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