为什么在view中添加一个botton字体会被加粗左边也有边距了?

发布于 8 年前作者 fanyang13983 次浏览最后编辑 8 年前来自 issues

1 回复
xiexia
xiexia1 楼5 年前

button有默认样式的

建议这样写

view

<view class='view'>
    <button class='button' open-type='share'></button>
    分享
</view>

css

.view{
  position: relative;
  color: #333;
}
.view .button{
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
}
.view .button::after{
  display: none;
}