html - Internet Explorer 中的 Segoe UI 字体

标签 html css fonts font-face

我在我的 CSS 文件中使用自定义的 Segoe UI 字体。此字体在 Chrome 中正确呈现,但在 IE 和 Firefox 中,它在某些地方显示默认字体。

这是CSS代码

body {
    margin:0px auto;
    padding: 0 0 0px 0;
    background-color:#eee;
    font-family:"Segoe UI";
    font-weight: lighter;
    font-size::11px;
    color:#333;
    overflow-y: scroll;
}
 @font-face {
     font-family:"Segoe UI";
 src: url(images/font/SEGOEUI.eot) format("truetype") /* EOT file for IE */
}
@font-face {
    font-family:"Segoe UI";
 src: url(images/font/SEGOEUI.ttf) /* TTF file for CSS3 browsers */
}

最佳答案

试试这个代码而不是你的代码:

 body {
    margin:0px auto;
    padding: 0 0 0px 0;
    background-color:#eee;
    font-family:'Segoe UI' !important;
    font-weight: lighter;
    font-size:11px;
    color:#333;
    overflow-y: scroll;
 }

@font-face {
  font-family: 'Segoe UI';
  src: url('fonts/SEGOEUI.eot'); /* IE9 Compat Modes */
  src: url('fonts/SEGOEUI.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('fonts/SEGOEUI.woff') format('woff'), /* Modern Browsers */
       url('fonts/SEGOEUI.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('fonts/SEGOEUI.svg#svgFontName') format('svg'); /* Legacy iOS */
  }

关于html - Internet Explorer 中的 Segoe UI 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20235193/

相关文章:

r - 导出为 pdf 在 ggplot2 中无法正确显示

javascript - 如何使用 svg "focusable"制作 iframe

javascript - 动画 Bootstrap 进度条

php - php 中带有 href 的 if 条件

javascript - 如何防止 flex 容器溢出/下溢?

jquery - 使用 JQuery 将 DIV 添加到事件菜单项

html - 排序两列,避免跳到新行

css - CSS-Shapes 已经成为现实了吗?

c++ - CreateFont() 创建的字体规范和大小不正确

c# - 如何在 Windows Azure Web Apps 中发布和使用字体?