There is no restriction on which units can be used where. If a property accepts a value in px margin: 5px it also accepts a value in inches or centimeters margin: 1. But in general you would use a different set of units for display on screen than for printing on paper. In the past, CSS required that implementations display absolute units correctly even on computer screens. But as the number of incorrect implementations outnumbered correct ones and the situation didn't seem to improve, CSS abandoned that requirement in Currently, absolute units must work correctly only on printed output and on high-resolution devices.
CSS considers that printers, unlike screens, do not need to have different sizes for px in order to print sharp lines. In print media, a px thus not only has the same visual appearance from one device to another, but indeed it is measurably the same. Use em or px for font sizes CSS inherited the units pt point and pc pica from typography.
Printers have traditionally used those and similar units in preference to cm or in. In CSS there is no reason to use pt , use whichever unit you prefer. There are Symbol: em Unit System: Typography. What is the Em? The em is a unit of length in the field of typography and uses the symbol em.
Symbol: pt Unit System: Typography. What is the Point? The point is a unit of length in the field of typography and uses the symbol pt. Responsive Typography directly contradicts this advice as it manipulates the root font-size directly and, for scalable typography, it's the way to go. There's a Fluid-responsive font-size calculator available to help with that.
The minimum font size should never be smaller than 10px. And that's for small print, asides, captions, or the like and not body copy itself. I'm very pleased to finally see font size increasing generically across the web. Erik D. Kennedy has some well-thought-out guidelines for font size on text heavy pages, such as blogs or articles, and also covers interaction heavy pages, such as email apps.
Font Size Guidelines. When setting a font size I mostly use the rem unit , which references the pages root font-size , and eliminates cascade issues. Though, in the rare case where I'm relying on the cascade, I fallback to em.
0コメント