1

I want to add a favicon to my ASP website like this

enter image description here

According to these topics: Image icon beside the site URL How to put an image on the tab bar next to the title of the page on the browser? I added my own link like this:

<head>
       <link rel="icon" href="/favicon-32x32.png"/>
</head>

But not showing anything? What's the wrong?

I've just tried my code again in notepad++ and it works fine, why then it is not working in my ASP.NET website?!

Community
  • 1
  • 1
  • 4
    Have you seen this post http://stackoverflow.com/questions/10665893/how-to-add-image-with-title-of-an-html-page/10666010#10666010 – Rahul Jan 29 '16 at 19:00
  • You should probably do some research before asking a question like this... – IE5Master Jan 29 '16 at 19:11

5 Answers5

4

In some older browsers (e.g., Internet Explorer 5), that's all it takes. For the latest versions of Firefox, Internet Explorer and Chrome, however, you need to add two links to your favicon to the head in your HTML. If you are using a master page, the same two links would go in the head on the master page.:

<head runat="server">
                <title>My Website</title>
                <link runat="server" rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
                <link runat="server" rel="icon" href="favicon.ico" type="image/ico"/>
</head>

The reason you have two links to the same favicon is to make sure your favicon works with most browsers. Some, such as Firefox, will work with either link. Internet Explorer versions 6 and 7 are especially picky. If you use both links, however, one is bound to work in almost any browser.

Vasim Shaikh
  • 4,485
  • 2
  • 23
  • 52
3

you can you use the different favicon types below:

<link rel="icon" type="image/x-icon" href="http://example.com/favicon.ico" />
<link rel="icon" type="image/png" href="http://example.com/favicon.png" />
<link rel="icon" type="image/gif" href="http://example.com/favicon.gif" />

depending on what file you want to use as icon of your site.

For other formats of favicon, you can refer on this site

Abbr
  • 372
  • 1
  • 15
1

The only thing I could think of, is to try and add type="image/png" to the link element. Make sure that the image is in the same directory as the file you are referring to.

<link rel="icon" type="image/png" href="/favicon-32x32.png"/>
Wowsk
  • 3,637
  • 2
  • 18
  • 29
1

Create your own 16x16 favicon

<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<link rel="shortcut icon" type="image/png" href="http://eg.com/favicon.png"/>
Amit
  • 77
  • 1
  • 1
  • 14
1

Ideally you want favorite icon with favicon.ico name (ico extension), and place it inside the root folder.

If not in root folder, you need to explicitly create a link tag. For example,

<link rel="shortcut icon" 
   href="//cdn.sstatic.net/stackoverflow/img/favicon.ico?v=4f32ecc8f43d">

FYI, you cannot simply rename file extension png to ico. Instead, you want to convert it in correct format.

I normally use this site to convert png to ico - http://convertico.com/

Win
  • 61,100
  • 13
  • 102
  • 181