user784637 user784637 - 1 year ago 54
HTML Question

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?

Answer Source

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