Reputation:
I'm loading the favicon using
<link rel="shortcut icon" href="../resources/img/favicon.png">
This path clearly exists but I dont get any image
all the times.
How do I fix this?
Upvotes: 1
Views: 3411
Reputation: 1252
Two possibilities.
(3. Your image is not correct spelled/does not exist, but I leave this option because that would be a failure, lol)
Try this:
<link rel="icon" type="image/png" href="../resources/img/favicon.png">
If this code above is not working, you need to fix the href path. (maybe move the favicon to the source map and put the favicon code inside the head
tag inside your index.php
)
In case you move the favicon to the source map:
<link rel="icon" type="image/png" href="favicon.png">
Some example code I have found on the internet:
<html>
<head>
<link rel="icon" href="demo_icon.gif" type="image/gif" sizes="16x16">
</head>
<body>
<h2>Hello world!</h2>
<p>Open this page in a <a href="tryhtml5_link_sizes.htm" target="_blank">new window</a> to see the favicon.</p>
<p><b>Note:</b> The sizes attribute is not currently supported in any of the major browsers.</p>
</body>
</html>
Explanation: https://www.w3schools.com/tags/att_link_sizes.asp
To be sure your favicon is loaded press CTRL+F5. Not sure if it is needed instead of 'just' F5 (page reload).
Upvotes: 1