How to serve fonts from different servers for IE users?

I have IE9 users who cannot see my custom fonts. At first I thought it was a CORS problem, but after some experimentation, I believe that this is because the security settings are such that IE does not under any circumstances allow any third-party content (this is in a massive conservative corporate network of managed computers )

It can also be a problem for newer versions of IE installed for high security, I'm not sure.

Therefore, I believe that the best solution is to serve fonts directly from my domain for IE users, and not from CDN.

  • Does this sound like a good approach?
  • how can i do this with conditional comments?
+2
source share
1 answer

Here is a way to do this with conditional comments. I don’t know how your fonts and other styles are organized, but you probably want to use

<!--[if IE 9]>
    stylesheet using internally served fonts
<![endif]-->

and, perhaps,

<!--[if !IE]> -->
    stylesheet using CDN
<!-- <![endif]-->

The latter will apply not only to browsers other than IE, but also to IE10 and higher, but you may need to use only the first.

To answer your first question, I prefer to use fonts from my own servers in the production process. Reduces the number of moving parts and means that my site does not rely on another site.

+1
source

All Articles