Webp image file redirects to a file page onClick

I created a website and used the page speed tool to analyze the speed of my website and I was advised to compress my image into webp for better speed optimization. I followed the instructions and converted my image into webp format and added it to my HTML like this:

<picture>
  <source srcset="img/logo.webp" type="image/webp">
  <source srcset="img/logo.png" type="image/jpeg"> 
  <img src="img/logo.png" alt="HOTTUB PINAULT'S LOGO">
</picture>

and when I click on the logo image in my website I get the result in this screenshot:
webp file|495x493

How do i resolve this issue? Thank you for your help in advance

Hello there,

Generally, users expect to be taken to the homepage, when clicking on a sites logo. So, most are wrapped in a tags with a link to /.

Hope this helps

Thank you @Sky020. I have it wrapped in the <a href="/"></a> tag like this:

  <a class="navbar-brand" href="/">
       <picture>
  <source srcset="img/logo.webp" type="image/webp">
  <source srcset="img/logo.png" type="image/jpeg"> 
  <img src="img/logo.png" alt="HOTTUB PINAULT'S LOGO">
</picture>
      </a>

It does the same thing.

How are you hosting the page?

To me, it sounds like you have a local server running that has either started in the wrong folder, or you do not have an index.html script, so there is no default for the / path.

If you direct to your home page, what does the URL look like?

Thank you for your feedback again. It is a static website.
This is the weblink https://hottubpinault.netlify.app/
I’ve not made those changes to the hosted file but you can follow this link to see the earlier version before I made those changes. I’m making the change offline and testing.

Well, that site functions as I would expect it.

My guess is that your local folder structure does not match that of the hosted site. So, potentially, if you push the changes, the issue will not carry through.

Thank you for your help @Sky020 i’ll try everything you’ve suggested here hopefully it works. I appreciate your feedback and your time :pray: