【发布时间】:2017-02-25 09:37:57
【问题描述】:
我在我的项目中使用了 Font Awesome 图标。从 XSL 模板生成的 HTML 页面如下-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="IE=9; IE=EDGE" http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css?ver=T1.0" />
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css?ver=T1.0" />
<link rel="stylesheet" type="text/css" href="css/style.css?ver=T1.0" />
<link rel="SHORTCUT ICON" href="images/favicon.ico" />
</head>
<body>
</body>
在 stackoverflow 上搜索后,我在 head 中添加了元标记以将文档模式呈现为最新的可用版本。在 IE(IE9 和 IE11)兼容模式下,即使我的基本字体(Lato)也无法加载,并且仍然字体真棒图标在我的页面中消失。
请建议,我错过了什么?
问候,
这是我的 style.css -
@font-face{
font-family: 'Lato';
src: url('../fonts/lato-v11-latin-regular.eot');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: normal;
src: url('../fonts/lato-v11-latin-regular.eot');
src: local('Lato Regular'), local('Lato-Regular'),
url('../fonts/lato-v11-latin-regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/lato-v11-latin-regular.woff2') format('woff2'),
url('../fonts/lato-v11-latin-regular.woff') format('woff'),
url('../fonts/lato-v11-latin-regular.ttf') format('truetype'),
url('../fonts/lato-v11-latin-regular.svg#Lato') format('svg');
}
在其他浏览器 Chrome、FireFox 和 IE9 和 IE11(正常模式)中工作正常。 另一个想法是 - 如果通过控制面板(windows)在系统中安装字体 fontawesome-webfont.ttf 那么它工作正常。 正如一些网站的建议,我已经添加了两次字体。
【问题讨论】:
标签: html css internet-explorer fonts font-awesome