Sunday, January 12, 2025
HomeProgrammingHtml - How to Add a Browser Tab Icon (Favicon) for a...

Html – How to Add a Browser Tab Icon (Favicon) for a Website?

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.

See also  What is Windows - javatpoint

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″>

See also  Rules of Inference in Artificial Intelligence

</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.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x