起初为了节省代码量只在此标签加入background-size,类名只用background-image渲染,
发现图片并未加载。但又不想重复书写造成页面冗杂,故找寻并进行多次尝试运用于项 目中,代码如下:
i { display: inline-block; @include size(48px, 48px); background: no-repeat center/100%; background-image: url("image/success.png"); margin-bottom: 23px; margin-top: 50px; &.wait { background-image: url("image/ico_wait.png"); } &.pay { background-image: url("image/icon_cancel.png"); } }
注:background-size只适用于移动端,pc增加会出问题。。。