Do more formats in @font-face determine more http requests?

﹥>﹥吖頭↗ 提交于 2019-12-12 10:02:55

问题


Consider a similar css code:

@font-face {
    font-family: 'MyFont';
    src: url('../fonts/MyFont.eot');
    src: local('Proxima'), url('../fonts/MyFont.woff') format('woff'), url('../fonts/MyFont.ttf') format('truetype'), url('../fonts/MyFont.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

Does this code determine more HTTP requests to download all the formats or does the browser choose the best supported format?


回答1:


Nope, browser will choose one compatible format. Feel free to add as many sources as you like :)




回答2:


No, only one will be used. You can test it for example with firebug or google console and check the list of all requests that has been made (network tab)



来源:https://stackoverflow.com/questions/10338152/do-more-formats-in-font-face-determine-more-http-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!