Jump to content
  • 0

favicon: .ICO или все-таки .PNG (a W3C standard) ?


chich
 Share

ICO или PNG  

5 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Question

Всем привет!

Почему почти на всех сайтах код начинается с <!DOCTYPE HTML PUBLIC "-//W3C//DTD... - то есть получается что код валиден по стандартам W3C. Но почему же тогда везде используется favicon.ico вместо favicon.png?

Посмотрите тут http://www.w3.org/2005/10/howto-favicon

This document does not discuss in detail how to create a favicon image. However, the format for the image you have chosen must be 16x16 pixels or 32x32 pixels, using either 8-bit or 24-bit colors. The format of the image must be one of PNG (a W3C standard), GIF, or ICO.
The first approach for specifying a favicon is to use the rel attribute value "icon" and to define what the value means via a profile; profiles are discussed in more detail below. In this HTML 4.01 example, the favicon identified via the URI http://example.com/myicon.png as being a favicon:

<!DOCTYPE html 
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon"
type="image/png"
href="http://example.com/myicon.png">
[…]
</head>
[…]
</html>

И если кто-то врубится зачем юзать profile пожалуйста отпишите тоже

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Не все, что "валидно по стандартам W3C", понимается всеми браузерами (особенно IE). Как раз с PNG-картинками в IE издавна были проблемы (то гамма слишком темная, то прозрачность некорректно работает...). Ради кроссбраузерности приходится идти на компромиссы со строгостью стандартов, как и во многом другом. Имхо...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy