Place the file with your icon in the root directory of your site, with the peculiarity that it should be called favicon.ico
and must have the format ico
. This file is automatically requested by browsers and applies to all files of the domain.
If you want to use an image with another format to your pages you can use the following meta tag:
<link rel="icon" type="image/png" href="http://example.com/mi_image.png">
And it is recommended that the image be small and square. The most common dimensions are 16x16, 32x32, 64x64 px.
You can use online converters to create a favicon
from an image. Some places where you can do it are the following: