HTML5 Favicon
HTML
What is a favicon?
- A favicon (short for "favorites icon") is a small icon that represents your website.
- It appears in the browser tab, bookmarks, and sometimes in the address bar.
- Typically it’s a 16x16 or 32x32 pixel image in .ico format.
How to add a favicon in HTML4?
In HTML4, the favicon is linked using a <link>
tag placed in the <head>
section.
rel="shortcut icon"
— HTML4 way of telling the browser this is a favicon.href="favicon.ico"
— path to your favicon file.type="image/x-icon"
— specifies the MIME type.
HTML Version | Typical Usage |
---|---|
HTML4 | html <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> |
HTML5 | html<link rel="icon" href="favicon.png" type="image/png"> |