Icon is not displayed

I am trying to add an icon to my url-bar. But it does not appear, I am sure that the path is correct, because when I use it as a regular image, it appears. 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">
+5
source share
3 answers

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

Otherwise, it works on my site:

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

Try:

  • convert png to ico. There are free online tools like http://www.convertico.com/
  • make sure your path to the folder. Will not be ./imagesinstead ../images? Try providing the full URL. For example "http://localhost/mysite/images/favicon.ico".
  • .
+5

rel icon, shortcut icon.

Favicon, , :

<link rel="icon" type="image/png" href="<?= base_url('assets/images/logos/favicon.png'); ?>" />     
0

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

See W3C howto .

However, the format of the selected image must be 16x16 pixels or 32x32 pixels using either 8-bit or 24-bit colors.

0
source

All Articles