Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ie9 doctype and fonts?

<!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>

shows the font in chrome and firefox... but in ie9, if i add the doctype line, it breaks!? works fine without it.

i would like to get it working in all three browsers (with doctype? because sometimes other stuff like css relies on having doctype there? or doesn't look right without it) if possible?

thanks!

like image 258
Rakka Rage Avatar asked Feb 26 '11 01:02

Rakka Rage


2 Answers

Actually, this looks to be a feature. If you turn on the developer toolbar (F12), select the "Script" tab, and hit refresh on this test page, you should see something like this:

CSS3117: @font-face failed cross-origin request. Resource access is restricted. font?kit=_tMhxyW6i8lbI7YsUdFlGA

It looks like this is answered in a different post.

like image 133
paulcam Avatar answered Sep 23 '22 19:09

paulcam


Can you please try to add the content in the STYLE element to a css-file and replace STYLE with a LINK element refering to it?

IE executes inline scripts before external scripts, this may be a similar bug / feature.

like image 41
madr Avatar answered Sep 23 '22 19:09

madr