Favicon:.ico或.png /正确的标签? [英] Favicon: .ico or .png / correct tags?

查看:489
本文介绍了Favicon:.ico或.png /正确的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML5文档中,您推荐哪种favicon格式,为什么?我希望它能被IE7和所有现代浏览器支持。



另外,当使用.png时,是否需要指定类型(type =image / png )?

解决方案

为了与所有浏览器兼容,坚持使用 .ico
$ b

.png获得越来越多的支持,因为使用多个程序可以更容易地创建。



for .ico

 < link rel =快捷方式图标href =http://example.com/myicon。 ico/> 

为.png,您需要指定类型

 < link rel =icontype =image / pnghref =http://example.com/image.png/> 


In a HTML5 document, which favicon format do you recommend and why? I want it to be supported by IE7 and all the modern browsers.

Also, when using .png, do I need to specify the type (type="image/png")?

解决方案

For compatibility with all browsers stick with .ico.

.png is getting more and more support though as it is easier to create using multiple programs.

for .ico

<link rel="shortcut icon" href="http://example.com/myicon.ico" />

for .png, you need to specify the type

<link rel="icon" type="image/png" href="http://example.com/image.png" />

这篇关于Favicon:.ico或.png /正确的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆