Home > front end >  Favicon doesnt seem to work at all . the icon besides title
Favicon doesnt seem to work at all . the icon besides title

Time:05-05

i tried clearing dns cache and reloading still dont work . here is full code
main.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Matrex PortFolio</title>
    <link rel="shortcut icon" href="./favicon.ico" />
    <link rel="stylesheet" href="main.css">
</head>
<body>
    <h1>Soon</h1>
    <img src="/download.jpg" alt="" style="width: 100%; ;">
</body>
</html>

favicon.ico location is same as main.html . (they all in same directory.
main.css if anyone need it

    text-align: center;
    position: absolute;
    right: 50%;
    top: 50%;
    font-family:  Arial, Helvetica, sans-serif;
}
*{
    padding: 0;
    margin: 0;
}

im using a domain name , not local hosting

CodePudding user response:

If the favicon is in the same folder as the main.html file then you have the wrong html file path for favicon.ico.

You have:

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

you should have:

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

https://www.w3schools.com/html/html_filepaths.asp

CodePudding user response:

<link rel="icon" type="image/png" sizes="180x180" href="exemple.png">
  • Related