Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

favicon not showing

Tags:

html

I'm trying to add a favicon to my url-bar. But it's not showing up, I'm sure the path is correct because when I use it as a normal image it does show up. Here is the html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title> title </title>
    <link href = "styles.css" rel="stylesheet" type="text/css" />

    <link rel="icon" type="image/png" href="../images/favicon.png">
like image 622
user1548544 Avatar asked Aug 03 '12 13:08

user1548544


2 Answers

First, try to give the full URL istead. For example "http://localhost/mysite/images/favicon.png" (adapt it to your configuration, actually)

Otherwise, on my site, this works:

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

Try to:

  1. convert your png to ico. There are free online tools, for example http://www.convertico.com/
  2. be sure of your folder path. Won't be ./images instead of ../images? Try to give the full URL otherwise. For example "http://localhost/mysite/images/favicon.ico".
  3. after the above steps, try to clear the browser cache and reload the site.
like image 133
A_nto2 Avatar answered Nov 15 '22 08:11

A_nto2


use <link rel="icon" type="image/png" href="../images/favicon.png">

See W3C howto.

However, the format for the image you have chosen must be 16x16 pixels or 32x32 pixels, using either 8-bit or 24-bit colors.

like image 39
Vodun Avatar answered Nov 15 '22 08:11

Vodun