And*_*lly 7 css fonts internet-explorer font-face internet-explorer-7
我正在使用Open Sans字体作为正文文本,使用Font Squirrel生成的EOT,SVG,WOFF和TTF字体文件和样式表.我首先在页面标题中包含了我的字体CSS.但是当我在IE7,IE8甚至IE9中查看该网站时,我会在Open Sans开始之前获得Times Roman中的所有内容.这在其他浏览器中不会发生.
任何人都可以建议我可以阻止这种情况发生吗?这是我用于该字体的Font Squirrel CSS:
@font-face {
font-family: 'OpenSansRegular';
src: url('opensans-regular-webfont.eot');
src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-regular-webfont.woff') format('woff'),
url('opensans-regular-webfont.ttf') format('truetype'),
url('opensans-regular-webfont.svg#OpenSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
下载自定义字体时您看到的内容并未在上面的代码中定义。它在font-family整个 CSS 代码中的其他指令中定义。
在“OpenSansRegular”值后添加其他字体,以逗号分隔。从右到左:
serif、sans-serif、monospace或cursive(是的 Comic Sans!)。这OpenSansSth是 ... sans-serif。serif“Times New Roman”,Windows 中的默认字体是“Times New Roman”。这就是为什么您将 Times New Roman 视为 IE 中的 FOUC。OpenSansRegular在您的网站中前任:
nav { font-family: 'Custom_at-font-face','closest font to the font-face one but certainly rarely found on computers by default', 'less close, 'not close but same family', Verdana,sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
带百分比的兼容性表(可能有点旧)http://www.codestyle.org/css/font-family/
不要使用 10 个值,3 到 6 个就足够了;)在 2012 年 @font-face 可能会导致渲染问题取决于浏览器和操作系统(别名),但它得到了很好的支持,因此您可以缩短字体系列。