<number> - CSS: Cascading Style Sheets 编辑
The <number>
CSS data type represents a number, being either an integer or a number with a fractional component.
Syntax
The syntax of <number>
extends the syntax of <integer>
. A fractional value is represented by a .
followed by one or more decimal digits, and may be appended to an integer. There is no unit associated with numbers.
Interpolation
When animated, values of the <number>
CSS data type are interpolated as real, floating-point numbers. The speed of the interpolation is determined by the timing function associated with the animation.
Examples
Valid numbers
12 A raw <integer> is also a <number>. 4.01 Positive fraction -456.8 Negative fraction 0.0 Zero +0.0 Zero, with a leading + -0.0 Zero, with a leading - .60 Fractional number without a leading zero 10e3 Scientific notation -3.4e-2 Complicated scientific notation
Invalid numbers
12. Decimal points must be followed by at least one digit. +-12.2 Only one leading +/- is allowed. 12.1.1 Only one decimal point is allowed.
Specifications
Specification | Status | Comment |
---|---|---|
CSS Values and Units Module Level 4 The definition of '<number>' in that specification. | Editor's Draft | No significant change. |
CSS Values and Units Module Level 3 The definition of '<number>' in that specification. | Candidate Recommendation | No significant change. |
CSS Level 2 (Revision 1) The definition of '<number>' in that specification. | Recommendation | Explicit definition. |
CSS Level 1 The definition of '<number>' in that specification. | Recommendation | Implicit definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论