
[英]How can i change the width and height of an image inside a <source> element?
[英]how do i change width and height of the image in source element of html picture tag?
如何更改图片标签中源元素中图像的宽度和高度? 我应该使用具有相同图像的两个源元素并为不同的视口提供不同的宽度和高度,还是有另一种方法可以做到这一点?
<div class="model-image">
<picture>
<source
media="(min-width:568px)"
srcset="/images/hero-desktop.jpg"
height="659"
width="540"
/>
<img
src="./images/hero-mobile.jpg"
alt="hero-image"
class="hero-image"
/>
</picture>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.