小程序踩坑之旅

2019-07-31  本文已影响0人  子绎

button组件点击分享好友。默认样式问题。

  <button open-type="share" class='share_button' >
    
        </button>

我们往往可能不需要button默认的样式 只是想做一个简单的包裹而已,那么我们可以这样清除样式。

button{
    margin: 0;
    background-color: initial;
    padding: 0;
    border: none;
    line-height: initial;
这里要设置层级为2  因为button的层级最高,我们绑定的open-type事件,会在全部页面任何地方触发,我们只需要把层级改到最低就好。
    position: rective;
    z-index: 2;
}
然后清除默认的边框
button::after{
.share_button::after 
    border: none;
}

===================================2020-1-13更新
button {
    width: auto !important;
    margin: 0 !important;
    background-color: initial !important;
    padding: 0 !important;
    border: none !important;
    line-height: initial !important;
    position: rective !important;
    z-index: 2 !important;
    height: auto !important;
    min-height: auto !important;
}

button::after {
    border: none !important;
}

上一篇 下一篇

猜你喜欢

热点阅读