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!
The maximum range is ±2147483647. In CSS code bases, you'll often see z-index values of 999, 9999 or 99999. This is a perhaps lazy way to ensure that the element is always on top. It can lead to problems down the road when multiple elements need to be on top.
z-index defines which positioned element appears on top (Sort of like layers). So z-index: 1000 would appear on top of a z-index 999 . Doing z-index: 1001 is an an attempt to appear "on top" of a item with z-index: 1000.
CSS z-index property always work with absolute as well as relative positioning value. CSS z-index possible value 0, positive (1 to 9999) and negative (-1 to -9999) value to set an element. Properties. Value.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With