Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon not working

Tags:

html

favicon

My favicon that I am trying to insert into my webpage is not working. Can someone tell me the code and styling I need to insert it?

<html>
    <head>
        <title>Welcome to Crash - Login or Signup</title>
        <link rel="stylesheet" type="text/css" href="crash_styling.css"></link>
        <link rel="icon" href="/favicon.ico" type="image/x-icon">
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">      
    </head> 

    <body  link="#336666" alink="red" vlink="red">

        <div id="header_title">
            <h1 id="title">crash</h1>
            <p id="motto">Keep track of all your assignments and projects.</p>
        </div>  

        <form name="input" action="html_form_action.asp" method="get" id="user_passEntry">
            Username:<input type="text" name="username" placeholder="Your Username" /> <br />
            Password:<input type="password" name="password" placeholder="Your Password" />
            <input type="submit" value="submit">
        </form>

        <p id="description">Crash is a way students can keep track of their projects and assignments on the computer or on their devices. With crash, you can be sure you'll never turn in something late again.</p>

                <div class="make"><a href="crash_styling" style="text-decoration:none"/>Make a New Assignment</div>
                <div class="edit"><a href="crash_styling" style="text-decoration:none"/>Edit an Assignment</div>
                <div class="check"><a href="crash_styling" style="text-decoration:none"/>Check off an Assignment</div>
    </body> 

</html>
like image 507
th3w01f98 Avatar asked Jul 06 '12 13:07

th3w01f98


People also ask

Why does my favicon not work?

When you add a favicon to your site, it may not show up since your browser has 'saved' your site as one without a favicon. You need to clear the cache in your browser or use a different browser.

How do I get a favicon to work?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".

Why is my favicon not updating?

You will have to delete your cache from your browser, close your browser and reopen it. That should fix it. I don't believe your favicons will get refreshed on your favorites until you revisit that page, and assuming that you had previously cleared your browsers cache.


3 Answers

To place a Favicon on your site you would use the following in the <head> tag

<link rel="shortcut icon" href="http://yourwebsitepath/favicon.ico" />

You need to be sure that the path is correct for the icon. If the path is not correct it will not appear. I have also seen caching issues that makes it seem that the icon isn't working. Always try to restart your browser after clearing the cache.

like image 118
Taryn Avatar answered Oct 18 '22 18:10

Taryn


Sometimes forced reload fixes the problem. You need to reload the browser's caché memory.

  • Firefox: ctrl + shift + R
  • Chrome: ctrl + right click on Chrome's reload button
  • Edge: Same as Chrome, or ctrl + F5

Other combinations can be found in the above provided link.

like image 29
carloswm85 Avatar answered Oct 18 '22 16:10

carloswm85


Most likely you have a bad path to your icon. Confirm your file path. Try to use

href="favicon.ico"

instead of

href="/favicon.ico"

maybe it will work. Or if you have icon in some folder for example in images

href="images/favicon.ico"

You doing it right but if you will have bad path, icon won't appear.

So your CSS works and if your icon is on same level like CSS file so remove / and it should work.

like image 36
Simon Dorociak Avatar answered Oct 18 '22 18:10

Simon Dorociak