I'm getting favicon.ico error

后端 未结 13 1288
一个人的身影
一个人的身影 2020-11-30 19:02

I downloaded the Netbeans IDE to code in HTML. I\'m new to it. When I run my code, chrome is opening and everything is working just fine. I\'m getting some sort of error in

相关标签:
13条回答
  • 2020-11-30 19:29

    The accepted answer didn't work for me, I had to add a value to the href attribute:

    <link rel="shortcut icon" href="#" />
    
    0 讨论(0)
  • 2020-11-30 19:31

    In Angular earlier we had .angular-cli.json file which referred to favicon.ico. If you'll upgrade into one of the newer versions of Angular then you'll have angular.json instead. For these newer versions, you have to refer the favicon path in your index.html from now onwards.

    0 讨论(0)
  • 2020-11-30 19:32

    favicon.ico is the icon of a website on the title bar of your website. Netbeans couldnt find the favicon.ico file in your website folder

    if you dont want it, you can remove the line that is similar to this in your head section

     <link rel="shortcut icon" href="favicon.ico">
    

    or if you want to use an icon for the title bar, you can use icon convertor to generate a .ico image and keep it in your website folder and use the above line in the head section

    0 讨论(0)
  • 2020-11-30 19:32

    You can provide your own image and reference it in the head, for example:

    <link rel="shortcut icon" href="images/favicon.ico">
    
    0 讨论(0)
  • 2020-11-30 19:34

    The answers above didn't work for me. I found a very good article for Favicon, explaining:

    • what is a Favicon;
    • why does Favicon.ico show up as a 404 in the log files;
    • why should You use a Favicon;
    • how to make a Favicon using FavIcon from Pics or other Favicon creator;
    • how to get Your Favicon to show.

    So I created Favicon using FavIcon from Pics. Put it in folder (named favicon) and add this code in <head> tag:

    <link rel="shortcut icon" href="favicon/favicon.ico">
    <link rel="icon" type="image/gif" href="favicon/animated_favicon1.gif">
    

    Now there is no error and I see my Favicon:

    0 讨论(0)
  • 2020-11-30 19:41

    Also, be careful so your href location isn't faulty. Study case:

    My index page was in a temporary sub-folder named LAYOUTS. To reach the favicon.png from inside the IMAGES folder, which was a sibling of the LAYOUTS folder, I had to put a path in my href like this

    href="../images/favicon-32x32.png"
    

    Double periods are necessary for folder navigation "upwards", then the forward slash + images string gets you into the images folder (performing a tree branch "jump") and finally you get to reference your file by writing favicon-32x32.png.

    This explanation is useful for those that start out from scratch and it would have been useful to have seen it a couple of times since I would forget that I had certain *.php files outside the LAYOUTS folder which needed different tree hrefs on my links, from the HEAD section of each page.

    Reference the path to your favicon image accordingly.

    0 讨论(0)
提交回复
热议问题