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. python - 求一个在def中可以实现调用本def满足特定条件continue效果的方法(标题说不太清楚,请见题内描述)2. $fields = $values = [];这条代码一直定义不了,一直报错,老师的源码也是被报错的,执行不了,请问该怎么解决这个问题3. 求一个mySQL安装包4. javascript - mysql插入数据时怎样避免与库中的数据重复?5. mysql数据库做关联一般用id还是用户名6. MySQL中的enum类型有什么优点?7. MySQL 这句 创建表结构语句的错误在哪?8. node.js - 我想让最后进入数据库的数据,在前台最先展示,如何做到?9. 数据库设计 - MySQL数据库主键问题10. MySQL能否给某个字段的值设置有效期?
![$fields = $values = [];这条代码一直定义不了,一直报错,老师的源码也是被报错的,执行不了,请问该怎么解决这个问题](http://www.haobala.com/attached/image/news/202205/093622cb60.png)