Ask coding questions

← Back to all posts
How add Favicon to index.html
Alexthe2739

I don’t know why my favicon is just the default “no favicon” favicon

Answered by Panquesito7 [earned 5 cycles]
View Answer
Voters
Panquesito7
Alexthe2739
Comments
hotnewtop
Panquesito7

I had the same issue today. For me, it worked if you use a 32x32 icon. I hope that helps. 🙂

Alexthe2739

@Panquesito7 thank ya! :-)

Coder100

Hi! To use a favicon, you should read this article

So, for you:

The problem is that some things got cached, so hard refresh (usually ctrl+shift+r)

Alexthe2739

You don’t really help me all you know is what I know to! My problem: favicon.ico is in the root
and it’s up to 3 days ago that I created the favicon.ico and added the <link>-tag

greatusername

@Alexthe2739 I've run into this same problem and unfortunately I've found that the best way to fix this issue is to download all the files from replit, delete the entire repl, and create it again with a different name. Hope this helps!

xxpertHacker

First: eww, HTML is gross.

Secondly, if you're talking about the "favicon.ico", it must be accessible at the root directory of the website, which it properly is in your case.
At that point, the browser should request it automatically, all of the people here saying to use <meta> tags have no clue what they're talking about.

The only real problem here is that normally it takes a day or two to finally be recognized and fetched, after about a day it should work flawlessly, no extra effort required.

Forget about it today, tomorrow it should work just fine, if it doesn't come back, ping me (comment on this or get my attention), and I'll come to check if anything is wrong, but you shouldn't need to do anything except wait.

WSLTItanic

To add a favicon you have to upload the website to google buy paying or using repl.it or any other one like wix.com. I has tried it and it works it first was not but since I uploaded it in repl.it the favicon has appeared

If you feel this helpful please tick the tick mark

greatusername

@Alexthe2739 Did you run index.html before you added the favicon?

Whacko

You forgot the files.

realTronsi

@JavaMaster1 He is talking about the favicon, favicon.ico

Alexthe2739

@JavaMaster1 I wrote in line 10: <link rel="shortcut icon" href="/favicon.ico">

<link rel="icon" type="image/x-icon" href="/favicon.ico" sizes="16x16"> <link rel="icon" type="icon" href="/favicon.ico" sizes="16x16">
Whacko

@Alexthe2739 Oh I see. Favcions don't support .ico files, I think.

Alexthe2739

@realTronsi your right!

realTronsi

@JavaMaster1 No the default favicon file is .ico

Whacko

@realTronsi I think I'm right. Even @Alexthe2739 agrees!

realTronsi

@JavaMaster1 He replied your right! to my post. But I'm telling you favicons support .ico files, at least check or google it before declaring that you're right lmao

Alexthe2739

@JavaMaster1 nope... that’s not because index.html is the only file where it doesn’t seems to work. try https://alex2739.alexthe2739.repl.co/ysgggvvddthcht

Alexthe2739
Whacko

@Alexthe2739 Oh. Well, I figured out why. You need all these <meta> stuff in the head:

Or at least I THINK that's what's wrong. Try it out.

realTronsi

@Alexthe2739 You do have a lot of favicon tags, which maybe is causing the problem.

Just try adding that and removing the other ones

Alexthe2739

@realTronsi and @JavaMaster1 Ok I try both

realTronsi

@JavaMaster1 I thought all the meta tags were already in the head but lmao

Alexthe2739

@realTronsi and @JavaMaster1 Nope both of them doesn’t seem to work

realTronsi

@Alexthe2739 Strange, btw why do you have two index.html

Alexthe2739

@realTronsi the second index is a dir

Whacko

@Alexthe2739 Try renaming the file to favcion.png, I think it might work as a different file type.

Coder100

Nope, .ico files aren't supported in IE @JavaMaster1

Whacko

@Coder100 What?

Coder100

And meta tags do not effect the favicon either @JavaMaster1

Whacko