css 中的尺寸可以设置为“0”,没有任何单位吗?因为在我的世界里,“0 px”和“0 cm”、“0 em”甚至“0%”一样长。
例子:
width:0;
谢谢!
最佳答案
是的,它可以:非单位0
测量绝对没问题:
Lengths refer to distance measurements and are denoted by
<length>
in the property definitions. A length is a dimension. A zero length may be represented instead as the<number>
‘0’. (In other words, for zero lengths the unit identifier is optional.)
(强调我的)。
引用:
关于css - 可以将维度设置为 "0"而不带单位吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10984925/