1. 程式人生 > >iphone中input按鈕設置disabled屬性出現灰色背景沒有顯示問題

iphone中input按鈕設置disabled屬性出現灰色背景沒有顯示問題

import images round 開始 disable .cn 倒計時 pan color

在項目中發現發送驗證碼的按鈕,在點擊後添加disabled屬性後,iphone手機中出現disabled屬性的默認背景顏色沒有顯示,反而直接顯示它下面的父級元素的白色

點擊前技術分享

點擊後技術分享

倒計時的按鈕消失了
然後就開始了各種方案測試,一直在找是不是兼容性的問題,然後發現沒啥效果。
之後就從處理兼容性問題上轉移到直接設置樣式覆蓋掉disabled的默認樣式

1 input[type=button], input[type=submit], input[type=file],button{ cursor: pointer; -webkit-appearance: none;} 
2 input:disabled
{ 3 background-color: #C0C0C0!important; 4 color: #fff; 5 }

iphone中input按鈕設置disabled屬性出現灰色背景沒有顯示問題