CSS | Value Integer

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output

In this example column-count takes input an integer.

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


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.




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.