CSS <integer> Data Type
<integer> data type denotes an integer number, positive or negative.
When you see
<integer> (including the
>) anywhere in the CSS specifications, this refers to the fact that the value can be a valid integer.
An integer consists of one or more decimal digits
Integers can be immediately preceded by
- to indicate a negative value, or
+ to indicate a positive value.
Here are examples of valid
No unit identifiers are required with integers, however, a unit identifier may be required if the integer is part of another data type. For example, a
<length> value might look like this:
However, in this case, the CSS specifications will state that the value must be a
<length> (or whatever the value type is).
Also, strictly speaking, a
<length> is a dimension, which is a
<number> data type immediately followed by a unit identifier. The
<number> data type allows a broader set of values than the
You can't use a
. (dot) within an integer, so you can't use values like
2.5 in places where only an
<integer> data type is allowed.
<number> data type does allow dots.
column-count property accepts either of the following two values.
So you could write something like this:
Here's a working example:
<integer>data type is defined in CSS Values and Units Module Level 3 (W3C Candidate Recommendation, 29 September 2016)
- It is also defined in Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification (W3C Recommendation 07 June 2011)