Screenshot display of uniapp’s css style image size

Before taking a picture

Please add image description

After taking the picture

Please add image description

The first way: code

<view class="swiper-box-img">
	<image class="swiper-box-img-img" :src="item.file_path" mode="aspectFill"></image>
</view>
.swiper-box-img{
    
    
    width: 750rpx !important;
}
	
.swiper-box-img-img{
    
    
    width: 100% !important;
    height: 840rpx !important;
}

Second way: code

<view>
	<image class="swiper-box-img-img"  :src="item.file_path" mode="aspectFill"></image>
</view>
	
.swiper-box-img-img{
    
    
    width: 750rpx !important;
    height: 840rpx !important;
}

at last

If you think the article is good, remember to give it a thumbs up, follow it, and add it to your favorites. Please correct me if there are any mistakes. If you need to reprint it, please indicate the source. Thank you! ! !

Guess you like

Origin blog.csdn.net/m0_49714202/article/details/135260783