在寫界面的時候遇到這個問題:在iPhone上,button按鈕渲染異常,如圖
正常應該是這樣的
iPhone上的safari解析input 按鈕會以蘋果瀏覽器的默認UI渲染(蘋果的WKWebview,webKit),sarifa瀏覽器和微信iPhone端都是用的WKWebview,微信端網頁也是的
在input 樣式中加個 -webkit-appearance:none; 告訴瀏覽器我們不希望按鈕按蘋果的默認UI來渲染。
-webkit-appearance: none;
解決方案:
在css代碼中加上這段代碼
input[type="button"]{
-webkit-appearance: none;
}