The question in the title is already fully formulated, I can only explain why it is needed. Conveniently, this is mainly when adjusting positioning when you pick up coordinates. If you change the value from zero to non-zero in the selection process, and then again to zero, you will get tired of adding, then deleting px .
|
1 answer
As stated in the specification :
for zero lengths the unit identifier is optional
For zero values, the indication of units of measurement is optional.
Thus, it does not make any difference to indicate for the value 0 units or not.
In addition, oddly enough: 0px === 0em === 0%
|
flex: 0→flex-grow=0,flex: 0px→flex-basis=0px. Admittedly, I only know this case. But I do not exclude that there may be somewhere else in a similar situation. - Alexey Tencalceverything is according to the specification : it turns out that insidecalcis not yetlengthso you cannot omit the dimension in0. And the developer’s tools also show that the rule is incorrect if there is no dimension - Grundy