html - 在网页中加载外部字体。 Internet Explorer 的解决方案?

标签 html css font-face

在所有体面的网络浏览器中,@font-face 仅用于将外部字体加载到您的网页中。但是,对于早于 IE9 的 IE 版本,这不起作用。我想使用 Ubuntu 字体系列。 有什么好主意吗?

最佳答案

FontSquirrel将为您创建合适的跨浏览器 CSS。

示例 CSS:

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

这适用于 IE7 及更高版本,当然也适用于所有其他浏览器。

关于html - 在网页中加载外部字体。 Internet Explorer 的解决方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6996349/

相关文章:

javascript - 如何在javascript中使用cheerio获取子属性值

html - 服务器上的身份验证错误

javascript - 从内容可编辑 div 中删除?

Javascript 聊天文本到底部

css - 字体系列不适用于字体

javascript - addEventListener ("click",...) 立即触发

html - 带背景颜色的文本

css - 将页面分成两部分

css - 使用 Unicode 字体作为@font-face

css - Font Face Gotham 无法在我的 IE 8、9、10 上运行,但在我 friend 的 IE 上运行良好?