Does anyone what browsers support using the link tag for the favicon, as opposed to at the root of the site? I am considering doing that as an alternative to hosting the files at the root of each site because of an issue I’m having an issue in doing so.
The doctype on my two sites are:
First site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
Second site:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
The way to link to a favicon, which should be supported by all major browsers is:
According to this Wikipedia article, this way of referencing the icon is supported by Internet Explorer, Chrome, Firefox, Opera and Safari.
According to Microsoft, favicons has been supported since IE7.
Side-note
I believe using
<link>instead of just placing it in the root is generally the best strategy anyway. That way you are in control of what icon is displayed. Let’s say you want to change the icon sometime in the future. When using a link you can just rename the icon, forcing the browser to download the new icon. Otherwise there is a risk that the user will keep seeing your old icon, as it is loaded from the browser cache.