SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10
Try this code live
Lesson 15 of 35

HTML Favicon: Create & Add a Browser Tab Icon

4 min read · Free · No login needed

Look at your browser tabs. Each one has a small icon on the left of the title — that is the favicon (short for "favourite icon"). It is your website's tiny logo. Without one, the browser shows a plain default icon, and your site looks unfinished.

Diagram — see how it fits together
Infographic: the favicon in the browser tab

How to add a favicon

Make a small square image — 32×32 or 48×48 pixels is enough — save it as favicon.ico or favicon.png, put it in your website's main folder, and add this line inside the <head> of your page:

<link rel="icon" type="image/png" href="favicon.png">

Making the icon

Use any image editor to shrink your logo to a small square. Free online tools like favicon.io can turn a PNG or a letter into a proper favicon file in seconds. Keep the design very simple — at 16 pixels wide, fine details disappear. A single letter or a bold shape works best.

Where the favicon appears

Besides browser tabs, the favicon shows up in bookmarks, in the browser history, and on the phone home screen when someone saves your site. It is a small detail, but it makes your site look professional and easy to recognise.

Tip: Browsers cache favicons aggressively. If you change yours and the old one still shows, hard-refresh the page (Ctrl + Shift + R) or clear the browser cache.

What a favicon is

A favicon is the tiny icon a browser shows next to your page title — in the tab, in bookmarks, and in the browser history. It is usually 16 by 16 pixels, so small that you can barely see the detail. But it makes your site look finished and professional, and it helps visitors find your tab among twenty open ones.

Link attributes

AttributeValueDescription
reliconTells the browser this link is the page icon.
typeimage/png, image/x-iconThe file format of the icon.
sizes16x16, 32x32The size of the icon, so the browser can pick the right one.
hrefa file pathWhere the icon file is.

The link goes in the <head>. You can offer more than one size — the browser picks the best fit:

<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16.png">
Note: Browsers cache the favicon very strongly. If you change the icon and still see the old one, it is almost always the cache — press Ctrl + F5 for a hard refresh, or open the page in a private window to check.
Tip: The classic format is .ico, which can hold several sizes in one file and works in every browser, even very old ones. A modern .png works in all current browsers and is easier to create from a logo.

Common mistakes

  • Putting the <link> in the <body> — it belongs in the <head>.
  • Using a full-size logo as the favicon — a 2000-pixel image shrunk to 16 pixels looks like a blur. Design a simple, bold version.
  • Forgetting the file on the server — the link points to a file that must actually be uploaded.
  • Testing once and giving up when the old icon shows — clear the cache and try a private window first.

Example explained

  • <link rel="icon" type="image/png" href="favicon.png"> sits inside the <head> and tells the browser which file is the page icon — rel="icon" says what the link is, type says the format, and href says where the file is.
  • <title>Favicon</title> sets the text the tab shows, and the browser places the favicon just to the left of it.
  • <h1>My Site</h1> and the paragraph are the visible page content, while the favicon itself never appears in the body — it shows in the browser tab next to the title.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Favicon</title>
<link rel="icon" type="image/png" href="favicon.png">
</head>
<body>

<h1>My Site</h1>
<p>Look at the browser tab — it shows my favicon.</p>

</body>
</html>

Output

Output — how it looks in the browser
Output of HTML Favicon: Create & Add a Browser Tab Icon

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. What is a favicon?

It is the tiny icon shown next to the page title in the browser tab, bookmarks, and history.

2. How do you add a favicon to a page?

Save a small square image and add a link with rel icon inside the head of the page.

3. Why does an old favicon still show after changing it?

Browsers cache favicons aggressively, so hard-refresh the page or open it in a private window to check the new one.

Why learn this yourself — and not just ask AI?

AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

Android & iOS App Development using Flutter 2026
₹5,000
View
Summer Training in Python Programming 2026
₹3,000
View
AI Prompt Engineering Webinar 2026
View
Browse all courses
HTML — Lessons
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →