<view class='container'>
<text>这是个例子
</text>
</view>
.container{
border: 2rpx black solid;
width: 400rpx;
height: 200rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
<view class='image_'>
<image src="/images/2222.png" class='img' >
</image>
</view>
.image_{
display:flex;
justify-content: center;
}
.img{
width:400rpx;
height:400rpx;
}
微信小程序 图片居中(手机屏幕正中间)
page{
height:100%;
}
.image_{
display:flex;
height: 100%;
justify-content: center;
align-items:center;
}
.img{
width:400rpx;
height:400rpx;
}
微信小程序图片铺满全屏
<image src="/images/2222.png" class='img' mode='widthFix'> </image>
page{
height:100%
}
.imagesize{
display:flex;
height: 100%;
justify-content: center;
align-items:center;
}