Inspecting the Typekit ‘badge’ (a fixed-position ‘bug’ used to promote that service on their free plan) I came across the following:
z-index: 2e+09
I’m puzzled by that value – can anyone help me decipher it? Thanks
edit: link to example
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
2e+09is a notation for 2×109 (known as scientific notation), or 2,000,000,000. It is actually from SVG (as well as JavaScript), and not technically valid in CSS,but most browsers implement it anyhow, as in all other cases, SVG and CSS numbers match, and they would rather maintain only one parser for numbers, not two.Actually, after checking, I was wrong; the browsers I tried (Chrome, Firefox, Safari and Opera) appear to ignore values set using scientific notation in CSS. So, this actually does nothing at all (it is treated as if
z-indexwere not set at all, for a defaultz-indexof 0), but the intent was probably to position the bug over all other content on the page. There is currently some debate on the CSS standardization mailing list as to whether e-notation should be allowed in CSS; it was mentioned in the discussion that some browsers already support it, but the ones that I tried did not appear to.You can test for support with the following test case. If scientific notation is supported, then the green
divshould be on top; if it’s not supported, thus defaulting toz-index: 0, it will be on the bottom, and if it parses just the mantissa and not the exponent (which I could imagine certain buggy browsers doing), it would be in the middle.