I am trying to do something very simple and display an image I scraped off the web using HTML.
For some reason, it’s not working.
<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src="headline1.jpg" alt="headline" width="500" height="333"></img>
</body>
</html>
What I’m seeing on my localhost
I’ve tried changing the image location (src), changing it to a png, changing the image size. Can’t quite figure out what’s going on
4
Answers
I think the image tag don’t need of closing tag.
Replace the code
With below code:
This should normally work if you open index.html in a browser. However, if you are using something like Django (given that you have a folder named templates), I suggest you try to learn how static files like images are served in Django:
Django: How to manage static files (e.g. images, JavaScript, CSS)
please check path of Image
check following link
https://www.youtube.com/watch?v=xbYaWNB_hg8&list=PLZdBNNxWmMHgJVGxoRPBBV9SOCWOBrgBy&index=8