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