CSS data type integer represents <integer > .It is a whole number which can be positive(+) or negative(-) .Integer contains one or more than one digits between 0-9.No decimal value is allowed .
No units are required to represent an integer value. A lot of CSS properties take integer value like z-index, line-height, column-count, counter-increment, grid-column, etc.
Valid Integer
1, 29, 047, +67, +9086, -9821, -32
Inalid Integer
1.08, -9.86, 9.9t, 4/3
Example 1:
<!DOCTYPE html> <html> <head> <style> .gfg { column-count: 3; } </style> </head> <body> <h1>CSS Value Integer</h1> <div class="gfg"> CSS data type integer represents <strong><integer > </strong>. It is a whole number which can be positive(+) or negative(-) .Integer contains one or more than one digits between 0-9.No decimal value is allowed . No units are required to represent an integer value. A lot of CSS properties take integer value like z-index, line-height, column-count, counter-increment, grid-column etc. </div> </body> </html> |
Output

In this example column-count takes input an integer.
Example 2:
<!DOCTYPE html> <html> <head> <style> img { position: absolute; left: 0px; top: 0px; z-index: -1; } </style> </head> <body> <h1>The z-index Property</h1> <img src= width="100" height="140" /> </body> </html> |
Output

In this example z-index takes input an integer.Because the image has a z-index of -1, it will be placed behind the heading.
Recommended Posts:
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | Percentage Value
- CSS Value | Angle
- CSS | [attribute$=value] Selector
- CSS | [attribute=value] Selector
- CSS | [attribute*=value] Selector
- CSS | [attribute|=value] Selector
- CSS | [attribute~=value] Selector
- CSS | [attribute^=value] Selector
- CSS Value Resolution
- CSS Value Inherit
- CSS Value | Unset
- CSS Value | Initial
- CSS Value Time
- CSS Value String
- How to get hex color value of RGB value ?
- How to change an element color based on value of the color picker value using onclick?
- How to push a value based on matched value in PHP ?
- How to convert a pixel value to a number value using JavaScript ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

