追格小程序中如何更改任务中心的背景展示形式

追格官方小助手/ 2022年07月18日/ 小程序/ 浏览 978

追格小程序中任务中心的背景默认是用的 background-size: cover;

此时会保持图像的纵横比并将图像缩放成将完全覆盖背景定位区域的最小大小


代码如下:


	<view class="content" :style="background?'background: url(' + background + ') no-repeat center; background-size: cover;':''">


如果我们要改变背景方式,可以调整改属性,并增加背景图定位属性,颜色属性,来调整(可以根据自己需要调整各属性来完善UI调整)

代码如下:


	<view class="content" :style="background?'background: url(' + background + ') no-repeat center; background-size: contain;background-position: top;':''">



发表评论

暂无评论,抢个沙发...

客服 工单