小程序button去除边框问题
发布于 6 年前 作者 hdai 17098 次浏览 来自 问答

在网上搜了好多,但都是没有解决。所以来求助。点击抽奖因为要获取用户手机号,所以用了button。但是修改了好多,发现一直存在黑色的边框。

上代码

html

<button class="chou" style='background-image:url(https://xxx.cn/playbtn.png);'plain='true'  bindtap="{{isclick}}"  open-type="start" bindgetphonenumber="start" ></button>

css

.chou {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180rpx;
  height: 180rpx;
  z-index: 10;
  margin: auto;
  padding: 0;
  background-size: 180rpx 180rpx;
  background-repeat: no-repeat;
  border: none;
}
button::before {
  border: 0;
  border: none;
}
button::after {
  border: 0;
  border: none;
}
1 回复
button {
    margin: 0;
    padding: 0;
    background-color: inherit;
    position: static;
}
 
button:after {
    content: none;
}
 
button::after {
    border: none;
}

试试这个

回到顶部