css - autoprefixer沒有添加web-kit前綴
問題描述
在使用autoprefixer時,我嘗試了last 2 versions和 > 1%,生成的css中對box-sizing等樣式均沒有添加wbe-kit前綴.請問這個結果可用嗎?P.S.:項目只在移動端使用.(移動端瀏覽器/微信/app內嵌H5使用)
問題解答
回答1:可用。所有市佔>1%的browsers的最新兩個版本都不用prefix。
https://github.com/postcss/autoprefixer
Autoprefixer utilizes the most recent data from Can I Use to add only necessary vendor prefixes.
http://shouldiprefix.com/#box-sizing
.example { box-sizing: border-box; /* Ch, Saf 5.1+, IE 8+, Op 9+ */}
http://caniuse.com/#feat=css3-boxsizing
Global 97.61%unprefixed: 96.6%
Chrome has problems selecting options from the select element when using box-sizing: border-box and browser zoom level is less than 100%.
IE 8 ignores box-sizing: border-box if min/max-width/height is used.
IE9 will subtract the width of the scrollbar to the width of the element when set to position: absolute / fixed , overflow: auto / overflow-y: scroll
Safari 6.0.x does not use box-sizing on elements with display: table;
Android browsers do not calculate correctly the dimensions (width and height) of the HTML select element.
In IE8, the min-width property applies to content-box even if box-sizing is set to border-box.
Edit:
那些內嵌webview的app都是在用android的原生browser,但是我找不到官方的版本列表可用,不過android上了5以后,原生的webview變成可獨立於android的可升級版本system apk叫'Android System WebView'所以比較不用擔心版本落后,建議你去下載genymotion直接跑原生的Browser app去測試一下。
我只找到坊間android/webkit的列表,也可以參考google chrome的。
回答2:http://caniuse.com/ 瀏覽器大致版本,以及哪些瀏覽器應該增加前綴,都有標示
last 2 versions 這句話大致就是所有瀏覽器的最后兩個版本,所有你可以按照你的需求進行相應修改,我按照你的需求,給你個案例:
last 10 versions
相關文章:
1. Java反射問題:為什么android.os.Message的recycleUnchecked方法不能通過反射獲取到?2. 如何分別在Windows下用Winform項模板+C#,在MacOSX下用Cocos Application項目模板+Objective-C實現一個制作游戲的空的黑窗口?3. html5和Flash對抗是什么情況?4. php如何獲取訪問者路由器的mac地址5. javascript - 在 vue里面用import引入js文件,結果為undefined6. 前端 - node vue webpack項目文件結構7. 小程序怎么加外鏈,語句怎么寫!求救新手,開文檔沒發現8. python - linux怎么在每天的凌晨2點執行一次這個log.py文件9. javascript - vue-resource中如何設置全局的timeout?10. thinkPHP5中獲取數據庫數據后默認選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙
