我在 IE 11 上遇到字体问题。我的一些元素不能接受 font-family
。我有 .woff
和 .woff2
但它不接受我的字体。我该如何解决这个问题?
这是我的 CSS 代码:
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
src: url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.eot'); /* IE9 Compat Modes */
src: local('Roboto Thin'), local('Roboto-Thin'),
url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.woff2') format('woff2'), /* Super Modern Browsers */
url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.woff') format('woff'), /* Modern Browsers */
url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../webfonts/roboto/roboto-v18-cyrillic-ext_latin-100.svg#Roboto') format('svg'); /* Legacy iOS */
}
我正在使用如下的 font-family
规则:
body {
font-family: Roboto;
}
结果如下:
最佳答案
您的问题是您假设 Roboto
是内置网络字体,但事实并非如此。你需要引号:
body {
font-family: 'Roboto';
}
关于html - IE 11 上的字体支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52268168/