Browse DevX
Sign up for e-mail newsletters from DevX


CSS: Fonts and Text

Learn all kinds of things about altering fonts and text.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Text Values

Absolute: pt/pc/cm/mm/in
Relative: px/em/ex/%

ou can measure most font and text properties in either absolute or relative units. The tables below show the values and their options.

Absolute Units

unit abbreviation example
points pt font-size: 12pt
There are 72 points to an inch, 12 points to a pica.
picas pc text-indent: 2pc
There are 12 picas to an inch.
centimeters cm text-indent: 4cm
inches in text-indent: 1in
millimeters mm text-indent: 8cm

Relative Units

unit abbreviation example
pixels px text-indent: 30px
A pixel is one picture element on the display monitor; there are typically between 72 and 90 pixels/inch.
em space em text-indent: 4em
An em space is the width and height of the capital letter M in the current font size and design.
x space ex line-height: 3ex
An ex space is height of the body of the current font size and design, about the height of the lowercase letter x.
percentage of
parent's value
XX% font-size: 90%

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date