Search code examples
htmlfavicon

Do you have to include <link rel="icon" href="favicon.ico" type="image/x-icon" />?


I didn't include the following line of code in my head tag, however my favicon still appears in my browser:

<link rel="icon" href="favicon.ico" type="image/x-icon" />

What's the purpose of including it?


Solution

  • If you don't call the favicon, favicon.ico, you can use that tag to specify the actual path (in case you have it in an images/ directory). The browser/webpage looks for favicon.ico in the root directory by default.