Friday, December 5, 2008

Font Size: Leading and Trailing Zeroes

When specifying a font size, the value can have leading and trailing zeroes or they can be omitted completely. This does not affect the way the text is rendered.

Leading Zeroes

Zeros that appear at the beginning of a number are called leading zeroes. Example: font-size:0.5in - the first digit is a leading zero. In all major browsers, leading zeroes are optional. Therefore font-size:.5in is a valid way of specifying font size. There can also be more than one leading zero.

Trailing zero

Zeroes that appear after a decimal point and at the end of the number are called trailing zeroes. Example: font-size:2.50em - the last digit is a trailing zero. In all major browsers, trailing zeroes are optional. Therefore, all the following declarations result in the same font size:
font-size: 2.5em
font-size: 2.500em

No comments: