Layout.css.dpi

From MozillaZine Knowledge Base
Jump to navigationJump to search

Background

CSS can use a variety of units for specifying dimensions. These units are classified as either absolute or relative. Absolute units (inches, centimeters, millimeters, points, and picas) are intended for use when the final output medium is of known dimensions; for example, in a print stylesheet. When they are used onscreen, their actual values must be calculated based on the DPI of the screen.

This preference determines what DPI should be used for calculating the dimensions of elements set using absolute width units. Some examples: At 96dpi, a 12-point font is displayed with 16 pixels in size (calculated as 12/72 = 16/96); conversely, an 18px font is printed as 13.5pt (18/96 = 13.5/72, regardless of the actual printer resolution).

Previously known as browser.screen_resolution (in Firefox/Thunderbird 1.0.x) and browser.display.screen_resolution (in Firefox/Thunderbird 1.5.0.x and SeaMonkey 1.0.x).

Possible values and their effects

-1

Use the host system’s logical resolution or 96, whichever is greater, for interpreting dimensions specified in absolute units. (Default)

0

Use the host system’s logical resolution for interpreting dimensions specified in absolute units.

(any positive integer)

Use this number for interpreting dimensions specified in absolute units.

Caveats

  • This preference is not meant as a general “zoom” feature to scale all rendered web content.
  • This preference is not present by default on Windows.

First checked in

2006-02-28 by L. David Baron

Has an effect in

  • Firefox (all non-Windows versions since 2.0)
  • Thunderbird (all non-Windows versions since 2.0)
  • SeaMonkey (all non-Windows versions since 1.1)

Related bugs

Related preferences

External links