日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

favicon支持的图片格式

發(fā)布時間:2025/5/22 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 favicon支持的图片格式 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

為網(wǎng)站設(shè)置favicon有兩種方式:

1、網(wǎng)站根目錄下放置名為favicon.ico的圖片,瀏覽器就會自動獲取;

2、在頁面中通過<link rel="shortcut icon"??href="http://example.com/myicon.ico" />.

?

對于favicon來說,一般都是使用ico格式,不過對于根目錄的favicon圖片chrome、firefox、IE11等現(xiàn)代瀏覽器都支持PNG、GIF(無動畫)格式。對于通過link來設(shè)置的favicon格式,IE7+、現(xiàn)代瀏覽器都支持PNG、GIF格式,不過在IE7下圖片效果會很差。

對于蘋果設(shè)備,我們可以通過在head里寫入<link rel="apple-touch-icon" href="somepath/image.png" />、<link rel="apple-touch-icon-precomposed" href="somepath/image.png" />來設(shè)置。

?

?Google ChromeInternet ExplorerFirefoxOperaSafari<link rel="shortcut icon" href="http://example.com/myicon.ico" /><link rel="icon" href="http://example.com/image.ico" /><link rel="icon" type="image/vnd.microsoft.icon" href="http://example.com/image.ico" /><link rel="icon" type="image/png" href="http://example.com/image.png" /><link rel="icon" type="image/gif" href="http://example.com/image.gif" /><link rel="icon" type="image/x-icon"href="http://example.com/image.ico"/>favicon.ico?located in the website's rootprecedence: prefer root or (X)HTML linked version
Yes[4]Yes[4][19]Yes[4]Yes[4]Yes
YesYes (from IE 11)[20]YesYesYes
YesYes (from IE 9)[20]YesYesYes
YesYes (from IE 11)[20]YesYesYes
YesYes (from IE 11)[20]YesYesYes
Yes[4]Yes (from IE 9)[26]Yes[4]Yes[4]Yes
YesYesOptional[27]Optional[28]Yes
linked[22]linked[22]linked[22]??

?

參考文檔:

http://en.wikipedia.org/wiki/Favicon

http://msdn.microsoft.com/en-us/library/ms537656(v=vs.85).aspx

http://stackoverflow.com/questions/1344122/favicon-png-vs-favicon-ico-why-should-i-use-pngs-instead-of-icos

http://www.webmasterworld.com/html/3701134.htm

http://blogs.msdn.com/b/ieinternals/archive/2013/09/08/internet-explorer-favicons-png-link-rel-icon-caching.aspx

http://blogs.msdn.com/b/jeffdav/archive/2007/03/01/why-doesn-t-the-favicon-for-my-site-appear-in-ie7.aspx

轉(zhuǎn)載于:https://www.cnblogs.com/shinnyChen/p/3722529.html

總結(jié)

以上是生活随笔為你收集整理的favicon支持的图片格式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。