CSS | Value Integer (original) (raw)

Last Updated : 12 Oct, 2021

CSS data type integer represents .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

Invalid Integer

1.08, -9.86, 9.9t, 4/3

Example 1:

html `

CSS Value Integer

    <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>

`

Output

In this example column-count takes input an integer.
Example 2:

html `

The z-index Property

    <img src=

"https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" width="100" height="140" />

`

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.