z-index的最大值、最小值
生活随笔
收集整理的這篇文章主要介紹了
z-index的最大值、最小值
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
瀏覽器 | 最大值 | 超過最大值后變成 | 最小值 | 小于最小值后變成 | 備注 |
| IE6 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| IE7 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| IE8 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| IE9 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| IE10 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| IE11 | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| Firefox 2 | 2147483647 | 元素消失 | ? | ? | ? |
| Firefox 3 | 2147483647 | 0 | ? | ? | ? |
| Firefox?29(最新穩(wěn)定版) | 2147483647 | 2147483647 | -2147483648 | -2147483648 | ? |
| Safari 3 | 16777271 | 16777271 | ? | ? | ? |
| Safari 4 | 2147483647 | 2147483647 | ? | ? | ? |
| Safari 5.1.7(最新穩(wěn)定版) | 2147483647 | 數(shù)值不變 | -2147483648 | 數(shù)值不變 | 使用的是webkit內(nèi)核,所以和chrome一致 |
| Chrome 29 | 2147483647 | 2147483647 | -2147483648 | 數(shù)值不變 | ? |
| Chrome??35(最新穩(wěn)定版) | 2147483647 | 數(shù)值不變 | -2147483648 | 數(shù)值不變 | chrome允許設置超過最大值、最小值的z-index, 不過超出之后層疊樣式會使用最大值和 最小值來計算(比如設置為2147483648時, 會以2147483647計算層疊關系) |
| Opera 9 | 2147483647 | 2147483647 | ? | ? | ? |
| Opera 21(最新穩(wěn)定版) | 2147483647 | 數(shù)值不變 | -2147483648 | 數(shù)值不變 | 使用的是webkit內(nèi)核,所以和chrome一致 |
測試方法很簡單:兩個元素都絕對定位,然后分別設置z-index值(通過瀏覽器自帶開發(fā)工具修改css;js操作)。
結(jié)論:z-index的取值范圍為-2147483648 ~~ 2147483647。而C的Int型數(shù)據(jù)類型的大小也為-2147483648 ~~ 2147483647。說明CSS的z-index在C中是作為INT型計算的。一般z-index都不超過100000,所以基本上不用考慮大小問題。
PS:chrome中對于width和height的最大限制為33554428,這個有時間再做吧。
參考文章:
http://stackoverflow.com/questions/8565821/css-max-z-index-value
http://www.puidokas.com/max-z-index/
http://stackoverflow.com/questions/491052/mininum-and-maximum-value-of-z-index#answer-491105
http://www.quora.com/Cascading-Style-Sheets/Is-there-a-maximum-value-for-z-index
轉(zhuǎn)載于:https://www.cnblogs.com/shinnyChen/p/3758991.html
總結(jié)
以上是生活随笔為你收集整理的z-index的最大值、最小值的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 经验总结02-sql语句
- 下一篇: bzoj1601 [Usaco2008