The link tag is implemented to add a small icon to the title of the page Favicon.ico

Source: Internet
Author: User

Here's how to use it:
1.<Linkrel= "shortcut icon"type= "Images/x-icon"href= "./favicon.ico">where Favicon.ico need to be placed under the root directory (do not advocate this method, because the picture is not authorized, violates the standard,) 2,<Linkrel= "shortcut icon"type= "Images/x-icon"href= "Http://www.jd.com/favicon.ico">

Attention:
Here the Favicon must be 16*16 or 32*32, must be 8-bit or 24-bit color, the format must be PNG or ICO or GIF.
16*16/32*32 and 8-bit or 24-bit color and png/ico/gif.

use a picture in a different format: <  rel= "icon"  href= "animated_favicon.gif"  type= "Image/gif "/>  

about the difference between shortcut icon and icon Code

In the past, web designers and developers used a variety of methods to ensure that Favicon appeared. It is hard to make sure that Favicon can be displayed on all computers, even in a browser of the same version.
Another limitation of the following code is that it associates favicon with a particular HTML or XHTML document. To avoid this, the Favicon.ico file should be placed in the root directory. Most browsers will automatically detect and use it.
We recommend that you include the following two lines of HTML code:

 <  link  rel  = "shortcut icon"   href  = "Http://example.com/favicon.ico"   type  = "Image/vnd.microsoft.icon"   >  <  link  rel  = "icon"   href  = "Http://example.com/favicon.ico"   type  = "Image/vnd.microsoft.icon"  >  

However, only the first line is necessary because the "shortcut icon" string will be recognized by most standards-compliant browsers as a list of possible keywords ("shortcut" will be ignored and "icon" only), while the Internet The Explorer will use it as a separate name ("shortcut icon"). The result of this is that all browsers can understand this code. Adding a second row is necessary only if you want to provide another alternate image for the new browser, such as an animated GIF.

Images can often use any image format that is supported by the browser.
The. ico file format can usually be read by all browsers that can display favicon.
Set up the server to send the correct MIME ID:
1,ico file Image/vnd.microsoft.icon (or you can use Image/x-icon for compatibility reasons.) However, it is best to use the IANA registered MIME type because most mainstream browsers now support it)
2,gif file Image/gif
3,png file Image/png
4,ico: Includes multiple resolutions (the most commonly used are 16x16 and 32x32,mac OS x sometimes use 64x64 and 128x128) and bit depth (bits per pixel) (most use 4, 8, and 16 million BPP, i.e. 16, 256, and colors).
5,gif: Use 16x16,256 color.
6,png: Use 16x16,256 color or 24-bit.
Note: When Favicon.ico is placed at the root of the document, it will be found by some browsers that do not process the link component, even if there is no link to it on your site.

Reference: http://blog.csdn.net/ssisse/article/details/51705626

The link tag is implemented to add a small icon to the title of the page Favicon.ico

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.