Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
2.2.6 [CSS-Level2-2009] Section 4.3.2, Lengths
Collapse the table of content
Expand the table of content

2.2.6 [CSS-Level2-2009] Section 4.3.2, Lengths

C0001:

The specification states:

 The x-height of a font can be found in different ways. Some fonts contain reliable 
 metrics for the x-height. If reliable font metrics are not available, UAs may 
 determine the x-height from the height of a lowercase glyph. One possible heuristic 
 is to look at how far the glyph for the lowercase "o" extends below the baseline, 
 and subtract that value from the top of its bounding box. In the cases where it is 
 impossible or impractical to determine the x-height, a value of 0.5em should be 
 used.

Quirks Mode and IE7 Mode (All Versions)

The x-height of a font is always equal to 0.5 em.

IE8 Mode, IE9 Mode, IE10 Mode, IE11 Mode, and Edge Mode (All Versions)

The x-height is computed from font metrics and varies by font.

C0002:

The specification states:

 Child elements do not inherit the relative values specified for their parent; they inherit the computed values.
  
 In the following rules, the computed 'text-indent' value of "h1" elements will be 
 36px, not 45px, if "h1" is a child of the "body" element.
  
 body {
   font-size: 12px;
   text-indent: 3em;  /* i.e., 36px */
 }
 h1 { font-size: 15px }
  
 Absolute length units are fixed in relation to each other. They are mainly useful 
 when the output environment is known. The absolute units consist of the physical 
 units (in, cm, mm, pt, pc) and the px unit:
  •in: inches — 1in is equal to 2.54cm.
  •cm: centimeters
  •mm: millimeters
  •pt: points — the points used by CSS are equal to 1/72nd of 1in. 
  •pc: picas — 1pc is equal to 12pt.
  •px: pixel units — 1px is equal to 0.75pt.

All Document Modes (All Versions)

The "px" unit always equals 1/96 of the "in" unit, regardless of the physical resolution of the viewing device. However, Internet Explorer allows the user to zoom the page display size up or down. This changes the relationship between logical CSS pixels and physical pixels. For example, at 100 percent zoom, 1 CSS pixel equals 1 display device pixel, and at 125 percent zoom, 1 CSS pixel equals 1.25 device pixels. When printing, 1 CSS pixel equals 1/96 inch and is then converted to the actual output device resolution. For example, if the printer's resolution is 600dpi, 1 CSS pixel equals 6.25 device pixels and 1 CSS inch equals 600 device pixels.

Show:
© 2015 Microsoft