Sunday, January 1, 2012

CSS: Numbers: Real Numbers



By Richard York

Real Numbers

Real numbers can have a decimal value, and decimal values increase the precision of measurements in CSS. As was the case for integers, real numbers in CSS can also be preceded by plus (+) or minus () to indicate the number’s sign. The value 1.2em, for example, means 1.2 times the font size. As in mathematics, a positive sign is assumed if no sign is present. If I have a declaration that says margin-left: -1.2em;, this causes an element to shift to the left 1.2 times the font size.
CSS provides some basic and reasonable rules for the specification of integers and real numbers in property values. CSS is also very flexible with how colors are specified
Post a Comment