微信小程序 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:1;
border-radius:5px;
-webkit-tap-highlight-color:transparent;
overflow:hidden;
color:#000000;
background-color:#fff;}
// 邊框樣式
button::after{border: 0;}
// 禁用時樣式
button[disabled] {background-color: #fff;color: #666; } 
// 點擊時樣式
.button-hover {color:rgba(0, 0, 0, 0.6);background-color:#fff;}

重置樣式

button{
   margin:0;
   padding:0;
   background-color:rgba(0,0,0,0);
   line-height:inherit;
   border-radius:0;
   border:none;
   display:flex;
   justify-content:center;
   align-items:center;
}
button::after{
   border: none;
}
.button-hover {
background-color:rgba(0, 0, 0, 0);
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM