Why do we always see this number 32767px in the css file

Is it used for a neat thing in the opera, I know that the Opera browser has a limitation that the element cannot be wider than 32767px.

Is this a standard number? (I do not think so)

What about other browsers? like chrome firefox IE, do they have the same limitation?

Thanks,

+4
source share
1 answer

Some people will immediately notice 32,767 as a software maximum value for an integer, which is a problem. opera for some reason, and this is absolutely one here, like all other browsers, even the dangerous Internet Explorer 6, can handle CSS values ​​that exceed this limit. Opera will fail to not warn about it and ignore all styles that follow the integers in your selector.

There was no way around this to find it in Opera, just type.

Any number greater than 32,767 for the value in CSS when displayed with Opera 10 will be ignored and will cause all of the following styles in this selector to be deleted.

http://www.aplusdesign.com.au/blog/opera-css-integer-bug/

So, in short, no, this should not affect other browsers. It is "standard" because it refers to an integer maximum value. This is the highest number that can be represented in a signed 16-bit integer (more precisely, the range is from 2 ^ 15-1 to -2 ^ 15 or from 32767 to -32768).

Edit: however, in other browsers there were too few errors related to the same maximum value, for example, iframe size limit error in Firefox, so things related to the same number may appear in different contexts with other browsers. But the CSS value error should only be Opera.

Edit2: webinista pointed out in the comments that Opera should be fixed starting from version 11.60, and after that the magic number will not be needed.

+5
source

Source: https://habr.com/ru/post/1412925/


All Articles