微信小程序中样式问题

1、去除button按钮的默认样式
这是button按钮自带的默认样式
button {
position:relative;
display:block;
margin-left:auto;
margin-right:auto;
padding-left:14px;
padding-right:14px;
box-sizing:border-box;
font-size:18px;
text-align:center;
text-decoration:none;
line-height:2.55555556;
border-radius:5px;
-webkit-tap-highlight-color:transparent;
overflow:hidden;
color:#000000;
background-color:#F8F8F8;
}

  默认是有边框的,如果直接用样式覆盖是不行的,它是通过 : : after伪类添加的
  这样写才有效果  :
  button::after {
      border: none;
 }
    
  然后根据自己的需求进行其他的操作,比如去除默认的灰色,就可以直接使用样式覆盖了
  button {
      background-color: #fff;
  }
posted @ 2019-03-27 17:28  静水思流  阅读(1129)  评论(0编辑  收藏  举报