Click here to Skip to main content
15,893,622 members
Articles / All Topics

How to Add Favicon

Rate me:
Please Sign up or sign in to vote.
3.80/5 (4 votes)
4 May 2014CPOL 8.3K   4   1
How to add Favicon

Introduction

Favicon is a image\icon displayed alongside the address of a website and also shown as icon in your favorite/bookmark list of website.

image

How to Add a Favicon

  1. Create an icon (.ico) file which you want to show in address bar, on tab or icon in favorite item.
  2. Name it as favicon.ico and place it on the root folder of your website.
  3. Add the below tag under <Head> section.
    HTML
    <link href="favicon.ico" rel="Shortcut Icon" />

Points to Remember

  1. Size of icon should not exceed dimension 16 x 16.
  2. Browsers can keep your favicon in their cache, so even if you have changed it, old icon can still be shown to user by the browser.
  3. In case the above line of code is not working, try using this:
    HTML
    <link rel="icon" type="image/ico" href="favicon.ico" /> 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
Programming is my passion. It is always fun to learn new things.

Follow my blog
Follow on FB

Comments and Discussions

 
GeneralMy vote of 1 Pin
Gerd Wagner5-May-14 11:34
professionalGerd Wagner5-May-14 11:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.