【发布时间】:2023-03-06 19:56:02
【问题描述】:
无论我尝试做什么,我都无法显示图标,当我在视图源选项卡中查找它时,它会加载但不会出现在选项卡图标位置。
我将它导入到 html 中,如下所示:
{% load static %}
<link rel="stylesheet" href="{% static "css/index.css" %}"/>
<link rel="Favicon" type="image/png" href="{% static 'images/icon.png' %}"/>
我这样设置 django staticfile_dirs:
STATICFILES_DIRS = [
os.path.join('static'),
os.path.join('static/images'),
]
【问题讨论】:
-
不应该是
rel="icon"吗?如果您在浏览器中访问该 URL,会发生什么情况? -
当我访问网址时,它会将 img 加载到新标签中
-
天哪,当我把它 rel="icon" 绘制成 rel="icon",tnx 很多。