Source Tag in Picture Element not Accepting Local Path in HTML

132 views Asked by At
<picture>
        <source media="(min-width: 900px)" srcset="Data for Practice/Random 6.jpg" style="width: 100px;height: 200px;" alt="Random 6">
        <img src="Data for Practice/Random 5.jpg" style="width: 200px;height: 200px;">
</picture>

So I was practicing using the picture element in html, when I encountered this issue. So what happens is that when I use srcset for an image in a local folder the image never shows up instead it uses the fallback image "Random 5". But when I use a URL link from Google or somewhere else the image shows up completely fine. I am using Chrome's latest version and using Visual Studio Code for coding. Please help!!

0

There are 0 answers