Internet explorer ie9文档类型和字体? 测试Ubuntu 正文{字体系列:“Ubuntu”,无衬线;} 测试Ubuntu

Internet explorer ie9文档类型和字体? 测试Ubuntu 正文{字体系列:“Ubuntu”,无衬线;} 测试Ubuntu,internet-explorer,internet-explorer-9,google-webfonts,google-font-api,Internet Explorer,Internet Explorer 9,Google Webfonts,Google Font Api,显示chrome和firefox中的字体。。。但是在ie9中,如果我添加doctype行,它会中断!?没有它也行 如果可能的话,我想让它在所有三种浏览器中都工作(使用doctype?因为有时候css等其他东西依赖于有doctype?或者没有doctype看起来不太好) 谢谢 如果我添加 <!doctype html> <html> <head> <title>Test Ubuntu</title> <link

显示chrome和firefox中的字体。。。但是在ie9中,如果我添加doctype行,它会中断!?没有它也行

如果可能的话,我想让它在所有三种浏览器中都工作(使用doctype?因为有时候css等其他东西依赖于有doctype?或者没有doctype看起来不太好)

谢谢

如果我添加

<!doctype html>
<html>
  <head>
    <title>Test Ubuntu</title>
    <link href="http://fonts.googleapis.com/css?family=Ubuntu:regular" rel="stylesheet" type="text/css" />
    <style>
    body { font-family: 'Ubuntu', sans-serif; }
    </style>
  </head>
  <body>
    Test Ubuntu
  </body>
</html>

然后我可以在不破坏ie9字体的情况下添加doctype行


谢谢:)

能否尝试将样式元素中的内容添加到css文件中,并用引用该文件的链接元素替换样式


IE在外部脚本之前执行内联脚本,这可能是一个类似的错误/功能。

实际上,这看起来是一个功能。如果打开开发人员工具栏(F12),选择“脚本”选项卡,并点击此测试页面上的刷新,您应该会看到如下内容:

CSS3117:@font-face跨源请求失败。资源访问受到限制。
font?kit=\u tMhxyW6i8lbI7YsUdFlGA


看起来这在a中得到了回答。

但不是真正的解决方案。。。它可能会修复你的字体,但如果你回到IE8模式,它会破坏很多其他东西-/不同之处可能在于,在谷歌的预览网站上,字体与页面来自同一个域,但在你的网站上,字体来自不同的域。外部css的行为似乎相同
<meta http-equiv="X-UA-Compatible" content="IE=8" />