html
<picture>
<source media="(max-width: 480px)" srcset="图片地址">
<source media="(min-width: 481px)" srcset="图片地址">
<img src="图片地址" id="homebanner">
</picture>
css
img{
height: 290px;
width: 100%;
}
// 小于992px
@media (max-width: 992px) {
img{
width: 100%;
height: 180px;
}
}