11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
22<html lang="en">
3- <!-- $Id: syndata.src,v 2.180 2010-09-29 15:52:58 bbos Exp $ -->
3+ <!-- $Id: syndata.src,v 2.181 2010-10-28 18:20:30 bbos Exp $ -->
44<head>
55<title>Syntax and basic data types</title>
66<meta name="editor" lang="tr" content="Tantek Çelik">
@@ -829,7 +829,7 @@ non-negative value.
829829
830830<h3><a name="length-units">Lengths</a></h3>
831831
832- <p>Lengths refer to horizontal or vertical measurements.</p>
832+ <p>Lengths refer to distance measurements.</p>
833833
834834<p> The format of a length value (denoted by <span class="index-def"
835835title="<length>::definition of"><a name="value-def-length"
@@ -849,25 +849,29 @@ supported.
849849 negative length values, the declaration is ignored.
850850</p>
851851
852+ <p>In cases where the <a href="cascade.html#usedValue">used</a>
853+ length cannot be supported, user agents must approximate it in the
854+ <a href="cascade.html#actual-value">actual value.</a>
855+
852856<p><a name="absrel-units">There are two types of length units:
853857relative and absolute.</a> <span class="index-def" title="relative
854858units"><em>Relative length</em></span> units specify a length relative
855- to another length property. Style sheets that use relative units will
856- more easily scale from one medium to another (e.g., from a computer
857- display to a laser printer).
859+
860+ to another length property. Style sheets that use relative units
861+ can more easily scale from one output environment
862+ to another.
858863</p>
859864<p>Relative units are:</p>
860865<ul>
861866<li><strong>em</strong>: the <span class="propinst-font-size">'font-size'</span> of the relevant font</li>
862867<li><strong>ex</strong>: the <span class="descinst">'x-height'</span> of the relevant font</li>
863- <li><strong>px</strong>: pixels, relative to the viewing device< /li>
868+ <li></li>
864869</ul>
865870
866871<div class="example">
867872<pre><code class="css">
868873h1 { margin: 0.5em } /* em */
869874h1 { margin: 1ex } /* ex */
870- p { font-size: 12px } /* px */
871875</code></pre>
872876</div>
873877
@@ -919,50 +923,6 @@ the font size inherited by "h1" elements.</p>
919923document tree</a> (e.g., "HTML" in HTML), 'em' and 'ex' refer to
920924the property's <a href="about.html#initial-value">initial value</a>.
921925</p>
922- <p><a name="pixel-units">Pixel units</a> are relative to the
923- resolution of the viewing device, i.e., most often a computer
924- display. If the pixel density of the output device is very different
925- from that of a typical computer display, the user agent should rescale
926- pixel values. It is recommended that the pixel unit refer to the whole
927- number of device pixels that best approximates the reference pixel. It
928- is recommended that the <span class="index-def"
929- title="reference pixel|pixel"><em>reference pixel</em></span> be the
930- visual angle of one pixel on a device with a pixel density of 96dpi
931- and a distance from the reader of an arm's length. For a nominal arm's
932- length of 28 inches, the visual angle is therefore about 0.0213
933- degrees.
934- </p>
935- <p>For reading at arm's length, 1px thus corresponds to about 0.26 mm
936- (1/96 inch). When printed on a laser printer, meant for reading at a
937- little less than arm's length (55 cm, 21 inches), 1px is about
938- 0.20 mm. On a 300 dots-per-inch (dpi) printer, that may be
939- rounded up to 3 dots (0.25 mm); on a 600 dpi printer, it can
940- be rounded to 5 dots.
941- </p>
942- <p>The two images below illustrate the effect of viewing distance on
943- the size of a pixel and the effect of a device's resolution. In the
944- first image, a reading distance of 71 cm (28 inches) results
945- in a px of 0.26 mm, while a reading distance of 3.5 m
946- (12 feet) requires a px of 1.3 mm.
947- </p>
948-
949- <div class="figure">
950- <p><img src="images/pixel1.png" alt="Showing that pixels must become
951- larger if the viewing distance increases"> </p>
952- </div>
953-
954- <p>In the second image, an
955- area of 1px by 1px is covered by a single dot in a low-resolution
956- device (a computer screen), while the same area is covered by 16 dots
957- in a higher resolution device (such as a 400 dpi laser printer).
958- </p>
959-
960- <div class="figure">
961- <p><img
962- src="images/pixel2.png" alt="Showing that more device pixels (dots)
963- are needed to cover a 1px by 1px area on a high-resolution device than
964- on a low-res one"></p>
965- </div>
966926
967927<p>Child elements do not inherit the relative values specified for
968928their parent; they inherit the <a
@@ -983,30 +943,99 @@ h1 { font-size: 15px }
983943</div>
984944
985945<p><span class="index-def" title="absolute length"><em> Absolute
986- length</em></span> units are only useful when the physical properties
987- of the output medium are known. The absolute units are:
946+
947+ length</em></span>
948+
949+ units are fixed in relation to each other.
950+ They are mainly useful
951+ when the output
952+ environment is known. The absolute units consist of the physical units
953+ (in, cm, mm, pt, pc) and the px unit:
954+
988955</p>
989956<ul>
990- <li><strong>in</strong>: inches — 1 inch is equal to 2.54 centimeters.</li>
957+ <li><strong>in</strong>: inches — 1in is equal
958+ to 2.54cm.</li>
991959<li><strong>cm</strong>: centimeters</li>
992960<li><strong>mm</strong>: millimeters</li>
993- <li><strong>pt</strong>: points — the points used by CSS 2.1 are equal to 1/72nd of an inch. </li>
994- <li><strong>pc</strong>: picas — 1 pica is equal to 12 points.</li>
961+ <li><strong>pt</strong>: points — the points used by CSS are equal to
962+ 1/72nd of 1in. </li>
963+ <li><strong>pc</strong>: picas — 1pc is equal
964+ to 12pt.</li>
965+ <li><strong>px</strong>: pixel units — 1px is equal to 0.75pt.</li>
995966</ul>
996967
968+
969+ <p>For a CSS device, these dimensions are either anchored (i) by
970+ relating the physical units to their physical measurements, or
971+ (ii) by relating the pixel unit to the <i>reference pixel</i>.
972+ For print media and similar high-resolution devices, the anchor unit
973+ should be one of the standard physical units (inches, centimeters, etc).
974+ For lower-resolution devices, and devices with unusual viewing distances,
975+ it is recommended instead that the anchor unit be the pixel unit. For
976+ such devices it is recommended that the pixel unit refer to the whole
977+ number of device pixels that best approximates the reference pixel.
978+
979+ <p class="note">Note that if the anchor unit is the pixel unit,
980+ the physical units might not match their physical measurements.
981+ Alternatively if the anchor unit is a physical unit, the pixel
982+ unit might not map to a whole number of device pixels.</p>
983+
984+ <p class="note">Note that this definition of the pixel unit and
985+ the physical units differs from previous versions of CSS. In
986+ particular, in previous versions of CSS the pixel unit and the
987+ physical units were not related by a fixed ratio: the physical
988+ units were always tied to their physical measurements while the
989+ pixel unit would vary to most closely match the reference pixel.
990+ (This change was made because too much existing content relies
991+ on the assumption of 96dpi, and breaking that assumption breaks
992+ the content.)
993+
994+ <p>The <span class="index-def" title="reference pixel|pixel"><em>reference pixel</em></span> is the
995+ visual angle of one pixel on a device with a pixel density of 96dpi
996+ and a distance from the reader of an arm's length. For a nominal arm's
997+ length of 28 inches, the visual angle is therefore about 0.0213
998+ degrees. For reading at arm's length, 1px thus corresponds to about
999+ 0.26 mm (1/96 inch).
1000+ </p>
1001+
1002+ <p>The image below illustrates the effect of viewing distance on
1003+ the size of a reference pixel: a reading distance of 71 cm
1004+ (28 inches) results in a reference pixel of 0.26 mm,
1005+ while a reading distance of 3.5 m (12 feet) results in
1006+ a reference pixel of 1.3 mm.
1007+ </p>
1008+
1009+ <div class="figure">
1010+ <p><img src="images/pixel1.png" alt="Showing that pixels must become
1011+ larger if the viewing distance increases"></p>
1012+ </div>
1013+
1014+ <p>This second image illustrates the effect of a device's resolution
1015+ on the pixel unit: an area of 1px by 1px is covered by a single dot
1016+ in a low-resolution device (e.g. a typical computer display), while
1017+ the same area is covered by 16 dots in a higher resolution device
1018+ (such as a printer).
1019+ </p>
1020+
1021+ <div class="figure">
1022+ <p><img src="images/pixel2.png" alt="Showing that more device pixels (dots)
1023+ are needed to cover a 1px by 1px area on a high-resolution device than
1024+ on a low-res one"></p>
1025+ </div>
1026+
1027+
9971028<div class="example">
9981029<pre><code class="css">
9991030h1 { margin: 0.5in } /* inches */
10001031h2 { line-height: 3cm } /* centimeters */
10011032h3 { word-spacing: 4mm } /* millimeters */
10021033h4 { font-size: 12pt } /* points */
10031034h4 { font-size: 1pc } /* picas */
1035+ p { font-size: 12px } /* px */
10041036</code></pre>
10051037</div>
10061038
1007- <p>In cases where the <a href="cascade.html#usedValue">used</a> length cannot be supported, user agents must approximate it in the <a
1008- href="cascade.html#actual-value">actual value.</a>
1009- </p>
10101039<h3> <a name="percentage-units">Percentages</a></h3>
10111040
10121041<p> The format of a percentage value (denoted by <span
0 commit comments