I have this kind of code:
<picture>
<source srcset="Img/material.jpg" media="(min-width: 401px)">
<source srcset="Img/materialw400px.jpg" media="(max-width: 400px)">
<img id="material" srcset="Img/material.jpg" alt="Material">
</picture>
the question is, can we give that picture a link to other page?
I've already tried using <a> tag before the <picture> tag and inside the tag but none of these is working.
<a target="_blank" href="http://php.net">
<picture>
<source media="(min-width: 401px)" srcset="Img/material.jpg"></source>
<source media="(max-width: 400px)" srcset="Img/materialw400px.jpg"></source>
<img alt="Material" srcset="Img/material.jpg" id="material">
</picture>
</a>
It works fine.
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