如截图所示,cover-image 的高度100%,宽度auto,但图片为什么依然被拉扯变形了?? 求解。。T_T
<cover-view class="ssss" style="background-image: url('https://www.baidu.com/img/bd_logo1.png');"></cover-view> .ssss { width: auto !important; height: 250rpx; background-size: contain; background-repeat: no-repeat; background-position: center; } 用背景图试试
块级元素设为auto会占满整个容器,没毛病