CSS <number> Data Type
Description
The <number>
CSS data type is an integer or number containing digits from 0 to 9 and a decimal fraction, in which the integer and decimal part are separated by a decimal point. If the number starts from zero, then it can be omitted (.5 instead of 0.5).
Example of valid numbers are:
-7, 9.999999, -58.6, 236, -45, 200.00, 44.2376, -0.3, 0, 20e4.
Syntax
property: <number>;
Values
- <number>A number can consist of the following: Digits 0 to 9, decimal point ( . ), addition ( + ), minus ( - ) or an exponent composed of "e" or "E" and an integer.
Example
<div>Hover over me...</div>
div {
transition-property: width;
transition-duration: 2s;
transition-timing-function: cubic-bezier(.63,.05,.43,1.7);
background: #634856;
color: white;
width: 140px;
margin: 10px;
padding: 10px;
}
div:hover {
width: 80%;
}
Browser Support
Desktop | |||||
5 | 12 | 1 | 1 | 2 | 1 |
Tablets / Mobile | |||||
![]() |
|||||
1 | 18 | 4 | 10.1 | 1 | 1.0 |
Last updated by CSSPortal on: 8th December 2019