-2

Hey guys I have a problem with displaying images in HTML file. I m working with flask in visual studio code. This is what I want to display :

<img src="/templates/WANG_CHONG_st_1.png" width="150" >

When I use python app.py (to run the localhost) image just doesnt show itself. I tried evrything that I found on the internet but nothing didnt work. But when i open that HTML file with live server image is there... I see it absolutely normal. Also when I'll run it trought python app.py and look into inspector there is the error message that says: Failed to load resource: the server responded with a status of 404 (NOT FOUND). Shouldn't be a problem also in that I had installed bootstrap and yesturday I installed also into this project teilwind. Shouldn't be a problem with this? Also here is my printscreen of visual studio code. There are few errors that may be connected with tailwind. image of vs. code

1 Answers1

0

So i solved it. The reason why it didnt display image was in instalation of tailwind. Tailwind needs to have style.css in folder named src or style. I was folowing this tutorial https://www.youtube.com/watch?v=5mgrioodze8&t=1215s&ab_channel=ROBWEBsyablkom (maybe you wont understand it) from 15:00 is instalation. what i did was i made src file where i put style.css. i put to style

@tailwind base;
@tailwind components;
@tailwind utilities;

than i made static folder. guy in a tutorial than making in package.json his function called build-css which he is calling than and sending another style.css to folder with templates but i did send it to static folder. example "build-css": "tailwindcss build src/style.css -o static/style.css". Evrything works now perfectly.