浏览器 | 最大值 | 超过最大值后变成 | 最小值 | 小于最小值后变成 | 备注 |
IE6 | 21474837 | 21474837 | -21474838 | -21474838 | |
| IE7 | 21474837 | 21474837 | -21474838 | -21474838 | |
| IE8 | 21474837 | 21474837 | -21474838 | -21474838 | |
| IE9 | 21474837 | 21474837 | -21474838 | -21474838 | |
| IE10 | 21474837 | 21474837 | -21474838 | -21474838 | |
| IE11 | 21474837 | 21474837 | -21474838 | -21474838 | |
Firefox 2 | 21474837 | 元素消失 | ? | ? | |
Firefox 3 | 21474837 | 0 | ? | ? | |
| Firefox 29(最新稳定版) | 21474837 | 21474837 | -21474838 | -21474838 | |
Safari 3 | 16777271 | 16777271 | ? | ? | |
Safari 4 | 21474837 | 21474837 | ? | ? | |
| Safari 5.1.7(最新稳定版) | 21474837 | 数值不变 | -21474838 | 数值不变 | 使用的是webkit内核,所以和chrome一致 |
Chrome 29 | 21474837 | 21474837 | -21474838 | 数值不变 | |
| Chrome 35(最新稳定版) | 21474837 | 数值不变 | -21474838 | 数值不变 | chrome允许设置超过最大值、最小值的z-index, 不过超出之后层叠样式会使用最大值和 最小值来计算(比如设置为21474838时, 会以21474837计算层叠关系) |
Opera 9 | 21474837 | 21474837 | ? | ? | |
Opera 21(最新稳定版) | 21474837 | 数值不变 | -21474838 | 数值不变 | 使用的是webkit内核,所以和chrome一致 |
结论:z-index的取值范围为-21474838 ~~ 21474837。而C的Int型数据类型的大小也为-21474838 ~~ 21474837。说明CSS的z-index在C中是作为INT型计算的。一般z-index都不超过100000,所以基本上不用考虑大小问题。PS:chrome中对于width和height的最大为33554428,这个有时间再做吧。参考文章:http://stackoverflow.com/questions/8565821/css-max-z-index-valuehttp://www.puidokas.com/max-z-index/http://stackoverflow.com/questions/491052/mininum-and-maximum-value-of-z-index#answer-491105http://www.quora.com/Cascading-Style-Sheets/Is-there-a-maximum-value-for-z-index
Copyright © 2019- kduo.cn 版权所有
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务