How does ?#iefix solve web fonts loading in IE6
Lots of articles in the web like this : http://www.fontspring.com/blog/fixing-ie9-font-face-problems suggest to add a ?#iefix
to the eot url. I was curious to know how is this going to solve the problem. Thanks.
IE8 and the older have a bug in their parsers for the src attribute. So if you include more than 1 font format in the SRC, IE fails to load it and reports a 404 error.
The question mark solves that problem as it fools IE into thinking the rest of the string (other src) is a query string, and therefore loading just the EOT file...
Other browsers will follow the specification and load just their required font type ...
You may wanna read Paul Irish's Bulletproof @font-face syntax to know more about some other of the why's ...
你可以做任何事情而不是?#iefix
:基本目标是在URL中的第一个字体文件之后放置一个?#something
作为@Rexyz已经回答的东西。
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#FooAnything') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
The ?#iefix
is there to stop the browser interpreting any characters after the ?
as a query string and therefore prevents another possible server error.
上一篇: 管理CSS爆炸