小程序踩坑之旅

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辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 微信小程序踩坑之旅: 写在前面: 微信小程序已经出来很长时间了,而几乎是在它出现的同时我知道了这个小东西的存在。在...
    Topu阅读 231评论 0 0
  • 小程序踩坑之旅 小程序子组件监听父组件的变化: app.js中 page中 神奇的textarea 不光是text...
    remix_huang阅读 208评论 0 0
  • 1.scrolll-view中的手动滚动导致页面渲染延迟 解决方法:滚动会导致所有异步阻塞,给页面对应的 .jso...
    普通不平庸阅读 326评论 0 0
  • 通过下面这两张与学生家长和学生对话截图,可以简单看出我对高中生三年的态度和认知。(学霸学神除外) 记得参加一培英高...
    知行思合一阅读 1,326评论 0 0
  • 使用 CirrOS 来验证映像服务的操作,这是一个小的 Linux 映像,可以帮助您测试 OpenStack 部署...
    坚果的野望阅读 320评论 0 0

友情链接更多精彩内容