CSS - max z-index value [duplicate]
Is there a maximum / minimum possible value for the CSS z-index
property?
Do different browsers have different maximum / minimum accepted values?
How will browsers handle a high / low value?
I thought I read somewhere once about a max z-index
value. Maybe I'm wrong.
Thanks in advance!
Solution 1:
These are the max values.
Browser Max z-index value When exceeded, value changes to: Internet Explorer 6 2147483647 2147483647 Internet Explorer 7 2147483647 2147483647 Internet Explorer 8 2147483647 2147483647 Firefox 2 2147483647 *element disappears* Firefox 3 2147483647 0 Safari 3 16777271 16777271 Safari 4 2147483647 2147483647 Chrome 29 2147483647 2147483647 Opera 9 2147483647 2147483647
Found it somewhere on the web.
Solution 2:
Incredibly, this is the chrome's max z-index value.
.css('z-index', '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999').css('z-index')
If you add one more digit it will go to 1e+308
Solution 3:
Found some newer information from 2012:
"Chrome, Opera and IE9 seem to be the only browsers supporting a true infinite value for the z-index, while Firefox is still using 2147483647 and Safari now engages in some strange rounding off behavior after a number exceeds 16 digits in length."
Here is the source: World War Z-index