..


Sponsored Links

CSS font-size: pt, px or em? Which units to use?

In principle we can say that every unit in CSS has allowed a precise intended use:

pt

Points (pt) is the unit of measurement used in printing processes and software (eg Microsoft Word) for the creation of printable documents. The printers, in fact, not "reason" in pixels but in points. If we send a print formatted text, in pixels, the printer will own to convert pixels into points. If you are preparing a stylesheet for printing, then the suggestion is to use pt to get a more precise result.

px

Pixels (px) are, of course, the 'unit of monitor or, more generally, the display (the resolution of which is the number of pixels of horizontal and vertical line).

em

The 'em, unlike pt and px is a' unit of measure (ie not fixed). To use this unit is defined in the body of the document, the default font size using pixels. Then, using em, you define the individual elements of the page.
The unit of measurement defined as follows (in "em") will be on the default font size. In essence, the em is a kind of multiplier default size. For example: if the default font size is 10 pixels, with a paragraph

 



 font-size: 1.5 em

 
will, in practice, a font of 15 pixels on the basis of this simple calculation:
 



 * 1.5 = 10px 15px

 

In the same category ...
E-Learning
CSS (Course) CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €.
HTML (Course) HTML (Course)
The markup language for the Web from 29 €.
Webmaster Advanced (Course) Webmaster Advanced (Course)
Become a professional Webmaster. From 39 €.
Sponsored Links