I recently came across this beauty in a monolith of a project enter image description here

And I started wondering, is there a max for the value of a css attribute?

put on hold as off-topic by Wasabi, OpticalResonator, Fred, Mark, hazzey Aug 15 at 17:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about engineering, within the scope defined in the help center." – Wasabi, OpticalResonator, Fred, Mark, hazzey
If this question can be reworded to fit the rules in the help center, please edit the question.

Well, the standard does not specify how big the max or should be. However, real implementations most likely are working with some fixed memory allocation sized numbers and those do have a maximum value. For z index in particular MDN lists, some maximums per browser and notes that this issue has been considered by standards agency ultimately rejected.

IE seems to have the lowest value and uses a 16 bit signed int which ranges from -32 767 to 32 767. Others have much higher numbers but most likely under 32 bit signed Ints which would give a max of 2 147 483 647. But they may also be internally floats.

Not the answer you're looking for? Browse other questions tagged or ask your own question.