简体   繁体   中英

What if the favicon is not named favicon.ico?

Are there any restrictions on naming the favorites icon (favicon) file as anything other than favicon.ico ?

I know for sure that it can be named anything, as long as the favicon tag refers to the correct file name.

For example:

<link href="/somefile.ico" type="image/x-icon" rel="icon" />
<link href="/somefile.ico" type="image/x-icon" rel="shortcut icon" />

The code above works just fine in displaying the icon.

What I want to know is does this violate any W3C/HTML specifications or this is permitted usage?

根据W3C ,首选方法是在html文档中实际指定favicon,而不是依赖于服务器根目录中的favicon.ico。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM