Home > Blockchain >  JPG Image Not Showing up in HTML
JPG Image Not Showing up in HTML

Time:03-19

Everything else on my HTML page is showing up OK except my "cute_corgis.jpg" image. There's no "official" error, but only the image icon is showing up.

Here's my code:

<img src='cute_corgis.jpg' width='130' height='50' alt='Cute Corgis'>

The image is in the exact same folder as this HTML file, and the image name is correct. What's the problem?

P.S. I am using PythonAnywhere to run this webpage, if that's relevant.

CodePudding user response:

Could you also post you directory hierarchy? Like this:

  • code
    • index.html
    • cute_corgis.jpg

CodePudding user response:

You'll need to use ./ as it doesn't know where to get the file from, ./ being the root directory the HTML is in.

<img src='./cute_corgis.jpg' width='130' height='50' alt='Cute Corgis'>
  • Related