小程序踩坑之旅

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;
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容