favicon not showing up in any way - html

I have in my index.html, between my <head> tags the following line of code:
{% block head %}
<link type="image/x-icon" rel="shortcut icon" href='static/img/favicon.ico'/>
{% endblock %}
This is not working somehow. But if I go to: 'http://127.0.0.1:5000/static/img/favicon.ico' The favicon shows up. So this means that the favicon works, it's displayable but I can't find a way to put it next to the URL as it should be. Thanks in advance

From your code, you have given and the URL provided it looks like it is a flask app.
If it is flask you need to load the static files as follows, which will help you to load the favicon as well.
<link rel="shortcut icon"
href="{{ url_for('static', filename='img/favicon.ico') }}">

Try it like this:
<link rel="icon" href="static/img/favicon.ico">

Related

Getting no route found for favicon-96x96.png errors in PHP logs

Occasionally I see these errors in my PHP log about favicon-96x96.png not found.
It looks like this:
No route found for "GET /assets/favicon-96x96.png" (from "https://test-project.com")
My head element has these favicons loaded:
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon-16x16.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ asset('favicon-96x96.png') }}">
So it should be found by any browsers without a problem.
Also I can't even reproduce this error, I only see it logged a few times a day.
Any ideas what kind of requests these could be? I don't have any controller called assets or any public folder named like this. Every favicon is in public folder.
If I'm not mistaken the 96x96 favicon is used by Google TV. How could I reproduce this behaviour?

Favicon not appearing

For some reason my favicon is not appearing on chrome. I am using django. And I have a file named favicon.ico in my static folder.
{% load static %}
<link rel="icon" href="{% static 'favicon.ico' %}"/>
Add the image in static folder and make sure the image is an ico file
Hope this may help:
{% load static %}
<link rel="shortcut icon" href="{% static 'yourappname/images/favicon.png' type='image/ico' %}"/>
OR
You can store favicon as a png file too.
<link rel="shortcut icon" href="{% static 'yourappname/images/favicon.png' type='image/png' %}"/>
Additionally:
Store your icon in yourappname/static/yourappname/images/favicon.ico path
Make sure you have written <link rel... between the <head> tags in your template.
Don't forget to use {% load static %} tag in your template.
You can find more details about 'using favicon' from this question.
You can try :
<link rel="shortcut icon" href="{% static 'players/images/liverpool.png' type='image/png' %}"/>

Laravel css not loading sometimes

This is a weird problem. On my login page the CSS will always load correctly.
But once i sign in to my application and get redirected to the dashboard, the CSS will almost always fail to load the first time although when i press F12 to see in the network tab if the CSS files are loaded; they are.. After some inactivity when i refresh the dashboard again the CSS may fail to load although the network tab sais it did load properly..
All CSS files exists and the HTML looks like this in the view:
{{-- CSS --}}
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('css/font-awesome/fontawesome.css') }}">
<link rel="stylesheet" href="{{ asset('css/font-awesome/solid.css') }}">
<link rel="stylesheet" href="{{ asset('css/font-awesome/regular.css') }}">
<link rel="stylesheet" href="{{ asset('css/choices.css') }}">
<link rel="stylesheet" href="{{ asset('css/common.css') }}">
<link rel="stylesheet" href="{{ asset('css/dashboard.css') }}">
#stack('css')
I have also tried to clean the browser cache with no luck.
Also i tried to composer dump-autoload, i don't know if that would help in any way but i tried it.. What could be causing this?
I have 2 images for reference.
The first one is when this weird error happens and the other one is how it looks just after i refresh it.

How to fix: favicon only showing up on the homepage of my website [duplicate]

This question already has an answer here:
How to properly reference local resources in HTML?
(1 answer)
Closed 2 years ago.
My favicon is only showing up on the home page of my website.
It's located in the root directory of my repo on github and i've added the following lines to the head.html and _config.yml files respectively.
I've tried multiple paths and file names. When inspecting the source code on other pages on the site it seems to link the relative path with /favicon.png at the end.
The home page source leads to the favicon.
<link rel="shortcut icon" type="image/png" href="favicon.png">
plugins:
- jekyll-feed
- jekyll-seo-tag
Here's my head.html file:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- seo -%}
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
<link rel="shortcut icon" type="image/png" href="favicon.png">
{%- feed_meta -%}
{%- if jekyll.environment == 'production' and site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
</head>
Should my favicon not show on every subpage and post on the site?
At present, it's only showing on the home page and not on any other page.
here's my repo:
https://github.com/Redm0nd/redm0nd.github.io
The webpage is www.dylanredmond.me
This issue can be fixed by adding a slash before favicon.png as below.
<link rel="shortcut icon" type="image/png" href="/favicon.png">
Without slash, favicon.png is related path so it is loaded from following path but it doesn't exist.
http://www.dylanredmond.me/jekyll/update/2019/04/30/favicon.png

Link tag not working with rel="manifest"?

Following is my code in an HTML page:
<html>
<head>
<link rel="manifest" href="{{ STATIC_URL }}manifest.json" />
<link rel="stylesheet" href="{{ STATIC_URL }}ng-grid.min.css" />
</head>
</html>
Both manifest.json and ng-grid.min.css are served from the same static folder.
ng-grid.min.css was loaded as soon as the page was rendered but manifest.json file is not loaded.
On inspecting using developer tools I couldn't find a request for manifest.json.
Am I missing something?
You missed a '/' in the statement.
<link rel="manifest" href="{{ STATIC_URL }}/manifest.json">