I am trying to use picture Tag in react app (jsx file) but it doesn't seems to work. Here is my code
<picture>
<source media="(min-width: 1024px)" src="image_Desktop.png"/>
<source media="(max-width: 768px)" src="image_Mobile.png"/>
<source media="(min-width: 768px) and (max-width: 1024px)" src="image_Tab.png"/>
<img src="image.png" alt="" styleName='brain-image'/>
</picture>
I tried giving attribute as srcset/src both in source tag but still not working.Any solution for the above problem?
If you are using srcset instead of using srcSet (with capital), this could be your problem.
Here is the another problem caused by usage of srcset:
Why is React.js removing the srcset tag on <img />?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With