小程序的一些坑吧

1、小程序背景图片 background-image

 WXSS是无法使用本地资源(即代码文件中的图片资源)

解决:

  1、使用网络图片

  2、使用base64  (把图片转为base64格式 网上有工具)

  3、不写在WXSS中,直接写在WXML中 

<view style="background-image: url('/assets/images/bg.png');">

2、input使用背景图片设置no-repeat还会出现两个背景图片

  这是是input样式中的 padding-left 引起的
解决:
  把背景图放在input标签的 外层

3、去掉button的圆角、灰色边框

  小程序的button的border属性或者圆角,都是写在after里面的

解决:

button::after {
    border:none;
    border-radius: 0;
}
button{
    border-radius: 0;
}

button::after {
  border:none;
  border-radius: 0;
}
button{
  border-radius: 0;
}

猜你喜欢

转载自www.cnblogs.com/zelzzz/p/9424703.html