3

I am making a HTML page that is unpublished and that I just started. The first thing I wanted to do was add a favicon to appear next to the title. I'm using google chrome and I noticed that other websites have favicons that appear next to the title in the browser, but mine wont show up. I'm new to favicons. The site is in a folder on my desktop named site. This is the code:

<!DOCTYPE html>
<html> 
    <head>
        <title></title>
        <link rel="shortcut icon" href="favicon.ico" />
    </head>
    <body>
    </body>
</html>
5

If I understood you well, your website isn't in a webserver in your computer ? If you are accessing your site with something like this file:///C:/Users/Me/Desktop/mysite.html, you are not in a webserver and gonna need one to access your site with something like this http://localhost/mysite.html.

The reason why is because Chrome seams to have problems with loading favicon files when your site isn't in a webserver environment(Don't ask me why, I really don't know). I've just tester your page in my desktop on Chrome and it dosen't work, after that I've tested on my localhost webserver and it works.

If you are not familiar with webservers, I would suggest this one if you are on windows WAMP server.. There should be infos there about how to install it(it's actually pretty easy). After that you gonna be able to put your website's files in the webserver's "public html folder" (C:/wamp/www/ in this case) and access your website with http://localhost/

Good luck :)

  • As an alternative to WAMP, you can simply install Python and run python -m http.server (for Python3) or python -m SimpleHTTPServer (for Python2) from the folder you want to locally host. – Tobias Kienzler Sep 14 '16 at 6:12
0
<link href="favicon.ico" rel="shortcut icon" />

Try this.

Also make sure it is pointing to the right location, and that the icon file can also be displayed in other browsers.

If it also does not display in other browser, you probably don't have a valid .ico file or your pointing to the wrong location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.