Search code examples
javascripthtmlgithubgithub-pagesfavicon

My favicon code isn't working.... I did the code like it said in a guide


So I'm building a website for my friend using Github hosting, and I want it to have a favicon. I have implemented this code:

<!--Favicon-->
    <!-- Opera Speed Dial Favicon -->
  <link rel="icon" type="image/png" href="favicon.png" />

<!-- Standard Favicon -->
  <link rel="icon" type="image/x-icon" href="favicon.ico" />

<!-- For iPhone 4 Retina display: -->
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="favicon.png">

<!-- For iPad: -->
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="favicon.png">

<!-- For iPhone: -->
  <link rel="apple-touch-icon-precomposed" href="favicon.png">

but whenever I open the page, there's no favicon. I got the code from this guide here, but alas, it's not working... If someone could help me it'd be greatly appreciated... The github pages version can be found here.


Solution

  • You've put the <link> tag for the favicon inside the <body> tag, but it needs to be in the <head>

    enter image description here