Favicon
Favicon
What a Favicon Is
Tab WITHOUT favicon: [ 🌐 HTML Tutorial ] ← generic globe/blank
Tab WITH favicon: [ <> HTML Tutorial ] ← your own icon
Adding One — the Tag
<head>
<link rel="icon" href="favicon.ico">
<!-- or a PNG, which is common today: -->
<link rel="icon" type="image/png" href="/favicon-32x32.png">
</head>
It is a <link> tag (the same tag family that attaches CSS), living in <head>. rel="icon" declares its role; href points to the image file. That's the whole requirement.
Formats and Sizes
| Format | Note |
|---|---|
| .ico | The classic — can hold multiple sizes in one file; works in every browser including old ones |
| .png | Easy to make, transparent, sharp; the common modern choice (use 32×32 or 48×48) |
| .svg | Vector — one file scales to any size; supported by modern browsers |
Mobile and Apple Icons — the full set
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">
Different places need different sizes: 16×16 for the tab, 180×180 for when an iPhone user adds your site to their home screen (apple-touch-icon), and the manifest for Android. A favicon generator produces this whole block — you just paste it. For a school or business site, the apple-touch-icon matters: parents who "Add to Home Screen" then see your school logo as an app-like icon.
Why It Won't Update — the caching trap
yoursite.com/favicon.ico) to confirm the new file is live, add a version query (href="favicon.ico?v=2"), or test in Incognito. The file is usually correct; the browser is just showing a remembered copy.Exam Corner
Q: Which tag adds it?
<link rel="icon" href="favicon.ico"> inside <head>.Q: Common favicon formats? .ico, .png, .svg.
Q: What is apple-touch-icon for? The icon shown when an iOS user adds the site to their home screen.
Q: Favicon changed but old one shows — why? Aggressive browser caching; hard-refresh or add ?v=2.
Favicon क्या है
Favicon ke BINA tab: [ 🌐 HTML Tutorial ] ← generic globe/blank
Favicon ke SAATH tab: [ <> HTML Tutorial ] ← aapka apna icon
जोड़ना — Tag
<head>
<link rel="icon" href="favicon.ico">
<!-- ya PNG, jo aaj common hai: -->
<link rel="icon" type="image/png" href="/favicon-32x32.png">
</head>
यह <link> tag है (वही tag family जो CSS attach करती है), <head> में रहता है. rel="icon" उसकी भूमिका बताता है; href image file की ओर इशारा. बस इतनी ही ज़रूरत.
Formats और Sizes
| Format | Note |
|---|---|
| .ico | Classic — एक file में कई sizes रख सकता है; पुराने समेत हर browser में चलता है |
| .png | बनाना आसान, transparent, sharp; common modern choice (32×32 या 48×48) |
| .svg | Vector — एक file किसी भी size पर scale; modern browsers support करते हैं |
Mobile और Apple Icons — पूरा set
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">
अलग जगहों को अलग sizes चाहिए: tab के लिए 16×16, iPhone user के home screen में site जोड़ने पर 180×180 (apple-touch-icon), और Android के लिए manifest. Favicon generator यह पूरा block देता है — आप बस paste करते हैं. School/business site के लिए apple-touch-icon मायने रखता है: "Add to Home Screen" करने वाले parents को आपका school logo app जैसे icon के रूप में दिखता है.
Update क्यों नहीं होता — caching trap
yoursite.com/favicon.ico) यह पक्का करने को नई file live है, version query जोड़िए (href="favicon.ico?v=2"), या Incognito में test कीजिए. File आमतौर पर सही होती है; browser बस याद की हुई copy दिखा रहा होता है.Exam Corner
Q: कौन-सा tag जोड़ता है? <head> में
<link rel="icon" href="favicon.ico">.Q: Common favicon formats? .ico, .png, .svg.
Q: apple-touch-icon किसलिए? iOS user के home screen में site जोड़ने पर दिखने वाला icon.
Q: Favicon बदला पर पुराना दिखता है — क्यों? ज़ोरदार browser caching; hard-refresh या ?v=2 जोड़िए.
💻 Live Code Editor
इस पेज का code यहाँ तैयार है — बदलिए और तुरंत नतीजा देखिए. कुछ install किए बिना.console.log देखने के लिए F12 दबाइए.