z-index的最大值、最小值

來源:互聯網
上載者:User

瀏覽器 最大值 超過最大值後變成 最小值 小於最小值後變成 備忘
   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(最新穩定版)
2147483647
2147483647
-2147483648 -2147483648  
Safari 3
 16777271
16777271
? ?  
Safari 4
2147483647
2147483647
? ?  
Safari 5.1.7(最新穩定版)
2147483647
數值不變
-2147483648 數值不變 使用的是webkit核心,所以和chrome一致
Chrome 29
2147483647
2147483647
-2147483648 數值不變  
Chrome  35(最新穩定版)
2147483647
數值不變
-2147483648 數值不變

chrome允許設定超過最大值、最小值的z-index,

不過超出之後層疊樣式會使用最大值和

最小值來計算(比如設定為2147483648時,

會以2147483647計算層疊關係)

Opera 9
2147483647
2147483647
? ?  
Opera 21(最新穩定版)
2147483647
數值不變
-2147483648 數值不變 使用的是webkit核心,所以和chrome一致


結論:z-index的取值範圍為-2147483648 ~~ 2147483647。而C的Int型資料類型的大小也為-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


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.