To add a browser tab icon (favicon) to your website, you can use the <link> tag within the <head> section of your HTML document. Here are the steps:
1. Prepare Your Favicon
Create a favicon image, typically 16×16 or 32×32 pixels.
Save the file in .ico, .png, or .svg format.
2. Add the <link> Tag
Include the following code in the <head> section of your HTML file:
Example with .ico file:
html Copy code
<head>
<link rel=”icon” type=”image/x-icon” href=”favicon.ico”>
</head>
Example with .png file:
html Copy code
<head>
<link rel=”icon” type=”image/png” href=”favicon.png” sizes=”32×32″>
</head>
Example with .svg file:
html Copy code
<head>
<link rel=”icon” type=”image/svg+xml” href=”favicon.svg”>
</head>
3. Place the Favicon File
Ensure the favicon file is in the root directory of your website, or adjust the href path accordingly.
4. Test the Favicon
Open your website in a browser and verify that the favicon appears on the browser tab.