Ask coding questions

← Back to all posts
How do I add a tab picture to my website?
RhinoRunner (840)

I want to know how to put a picture on the tab for my website I'm making with Flask.
For example, replit.com has this as their image:

I've tried doing this but it doesn't work:

<link rel="icon" href="url_for('static',filename='images/logo.png')"/>
Answered by SixBeeps (5067) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17136)

you need to make it a template, like this:

<link rel="icon" href="{{ url_for('static',filename='images/logo.png') }}" />

also, make sure that you put the logo.png in:

static/images/logo.png

cool

IntellectualGuy (722)

Just do

<link rel="icon" href="images/logo.png"/>

You don't need anything else

RhinoRunner (840)

@IntellectualGuy Im using flask though, so that wont work. I tried it just in case and it still didn't work

IntellectualGuy (722)

@RhinoRunner Oh ok, I don't know how that works then

IntellectualGuy (722)

@RhinoRunner Also just in case you didn't know It's called a favicon