<integer>
Quick Summary for <integer>
The <integer> CSS data type is a special type of <number> that represents a whole number, whether positive or negative. Integers can be used in numerous CSS properties, such as column-count, counter-increment, grid-column, grid-row, and z-index.
Code Usage for <integer>
12          Positive integer (without a leading + sign) +123        Positive integer (with a leading + sign) -456        Negative integer 0           Zero +0          Zero, with a leading + -0          Zero, with a leading - 
More Details for <integer>

<integer>

The <integer> CSS data type is a special type of <number> that represents a whole number, whether positive or negative. Integers can be used in numerous CSS properties, such as column-count, counter-increment, grid-column, grid-row, and z-index.

Syntax

The <integer> data type consists of one or several decimal digits, 0 through 9 inclusive, optionally preceded by a single + or - sign. There is no unit associated with integers.

Note: There is no official range of valid <integer> values. Opera 12.1 supports values up to 2^15 - 1, IE up to 2^20 - 1, and other browsers even higher. During the CSS3 Values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in April 2012 during the LC phase, was [-2^27 - 1; 2^27 - 1], but other values like 2^24 - 1 and 2^30 - 1 were also proposed. However, the latest spec doesn't specify a range anymore.

Interpolation

When animated, values of the <integer> data type are interpolated using discrete, whole steps. The calculation is done as if they were real, floating-point numbers; the discrete value is obtained using the floor function. The speed of the interpolation is determined by the timing function associated with the animation.

Examples

Valid integers

12          Positive integer (without a leading + sign) +123        Positive integer (with a leading + sign) -456        Negative integer 0           Zero +0          Zero, with a leading + -0          Zero, with a leading - 

Invalid integers

12.0        This is a <number>, not an <integer>, though it represents an integer. 12.         Decimal points are not allowed. +---12      Only one leading +/- is allowed. ten         Letters are not allowed. _5          Special characters are not allowed. \35         Escaped Unicode characters are not allowed, even if they are an integer (here: 5). \4E94       Non-arabic numerals are not allowed, even when escaped (here: the Japanese 5, 五). 3e4         Scientific notation is not allowed. 

Specifications

Specification
CSS Values and Units Module Level 5 # integers

See also

<number>

Last modified: Nov 21, 2021, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語한국어Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
In this case my anchor this week becomes driving almost 2hrs outside of Atlanta to one of my favorite hard core gyms in the world.. MetroFlex aka The Dungeon. The gym owners turn the heat way up so it becomes a fun sweat box and the gym members just watch from afar and leave me alone. I happily drive myself long distances to find MY ANCHOR. Our anchor allows us to have balance, focus and be as productive as possible. And if you're in the middle of a heavy set and your headphones start to fall off your head, like mine did here.. well.. f*ck the headphones. Let em break and fall. You can always get a new pair, but the iron ain't ever gonna lift itself.
Unknown
Random CSS Property

all

The all shorthand CSS property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another stylesheet origin.
all css reference