Cascading Style Sheets Tutorial

Pt, px, DPI: on the length of the unit misunderstood

  Welcome to the CSS software tutorial area天极 


  In the print layout, the "point" is an absolute units, equivalent to 1 / 72 inches, can be used yardstick DD, physics inches.    However, in the meaning of CSS in pt not the case, for example, we specify a font is 9 pt, we would think that in accordance with the norms CSS, which means: 

  9 * 1 / 72 = 1 / 8 inch 

  This is a misunderstanding, because our monitors to be divided one by one pixel, there is only a single pixel color (To simplify, not here to discuss the pixel antialiasing technology), to appear on screen, they must first pt for the units to switch to the length of the units to pixels on the length of the conversion of the media, is DPI (in fact, the so-called DPI here is the operating system and browser to use the terminology, which is PPI, pixels per inch, and scanners, printers, digital cameras in the DPI is different concepts). 

  For example, no matter in which the operating system, the Firefox browser, the default is 96 DPI, in fact 9 pt = 9 * 1 / 72 * 96 = 12px. 

  Therefore, although the "DPI" the "I" and "1 pt equal to 1 / 72 inch," the "inch", which does not mean that the physics-inch, but the two units are equivalent to each other, will multiply in the About off. 

  So, how real physical length calculation? Please take a yardstick to measure the visibility of your display width (I have here is 11.2992 inches), divided by the horizontal resolution (I have here is 1024 pixels), each is received The physical pixel length. 

  Now we can answer such a question, page 9 pt font width is occupying more space? The answer is: 

  9 * 1 / 72 * 96 * 11.2992 / 1024 = 0.1324 inches = 0.3363 cm. 

  Interested friends can verify what their own. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: Length Units

Releated Posts

  • Client (CSS) solution automatically interception string length, and to substitute …
  • CSS learning Chapter 3: units and value
  • Css px units in the font and em
  • Headlines Show "…" exceed a certain length of the CSS approach
  • Notes js code (textbox judgement on the length of the largest fixed income and characters)

This entry was posted on Saturday, February 9th, 2008 at 12:00 am and is filed under CSS Properties. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Html forms and the use of mixed CSS web design
Against various versions of the browser hidden skills of CSS IX »

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial