开发者

HTML PNG as ICO without conversion

开发者 https://www.devze.com 2023-02-19 14:22 出处:网络
I want to use a png as an ico in html, how could I go by doing this? I can you can use a png by some code such as:

I want to use a png as an ico in html, how could I go by doing this? I can you can use a png by some code such as:

<link rel="ico" type="png/ico" href="link"/>

What is the correct way to use a png as an iso with out converting it to an开发者_StackOverflow中文版 actual ico?


You can't use a PNG as an ICO. They are different file formats.

You can specify that the Favicon is a PNG image, and the syntax is exactly the same as for any other Favicon except that the type is the PNG type.

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

Since a PNG isn't an ICO, the browser needs to support PNG images as Favicons for this to work.


Icons are just Bitmaps... You could just use one of these converters. Check out this question:

How to convert .ICO to .PNG?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号