Skip to content

Commit 2da285a

Browse files
committed
[css2] Added an illustration of line box formation, commented out for now.
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402959
1 parent 40b7a93 commit 2da285a

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

css2/visudet.src

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
22
<html lang="en">
3-
<!-- $Id: visudet.src,v 2.137 2009-08-06 19:22:15 bbos Exp $ -->
3+
<!-- $Id: visudet.src,v 2.138 2009-08-31 17:36:35 bbos Exp $ -->
44
<head>
55
<title>Visual formatting model details</title>
66
<style type="text/css">
@@ -1304,6 +1304,46 @@ increased to be that minimal height.</li>
13041304
still have margins, padding, borders and a line height, and thus
13051305
influence these calculations just like elements with content.
13061306
</p>
1307+
1308+
<!--
1309+
<div class=example>
1310+
<p>For example, a block element with two inline children like this
1311+
1312+
<pre>&lt;p&gt;&lt;span&gt;Fjord&lt;/span&gt; &lt;sup&gt;super&lt;/sup&gt;</pre>
1313+
1314+
<p>may consist of one line box whose height is calculated as shown in
1315+
the figure:
1316+
1317+
<div class=figure>
1318+
<p><img src="images/linebox.png" alt="(diagram)" style="max-width: 100%">
1319+
<p>A line box. See explanation in text.
1320+
</div>
1321+
1322+
<p>The font and the 'line-height' property of the P determine the
1323+
minimum height of the line box: (1) = ascender of P's first available
1324+
font; (2) = descender of that font; (3) P's 'line-height' value. (As
1325+
explained in 10.6, CSS2 also allows a UA to use another measure of the font
1326+
instead of the ascender and descender. In that case (1) + (2) is
1327+
likely to be bigger than 1em.) The solid red parts are the half-leading.
1328+
1329+
<p>Each glyph in the line box is placed relative to the line box's
1330+
baseline. Those in the SPAN have a 'vertical-align' value of
1331+
'baseline' and are thus placed on that baseline: (4) = the SPAN's
1332+
'line-height' value; (5) = the ascender of the letters in the SPAN;
1333+
(6) = their descender.
1334+
1335+
<p>The SUP element has a non-zero 'vertical-align' (b) and thus all
1336+
letters and the half-leading at the top and bottom are shifted up to
1337+
a new baseline position: (7) = ascender of glyphs in SUP; (8) =
1338+
descender; (9) is 'line-height' of the SUP element.
1339+
1340+
<p>The resulting line box (the grey box in the diagram) is tall enough
1341+
to enclose the tops and bottoms of all the contents. In this case, its
1342+
height (b) is larger than the line height of any individual part of
1343+
the line box.
1344+
</div>
1345+
-->
1346+
13071347
<h3><a name="leading">Leading and half-leading</a></h3>
13081348

13091349
<p>Since the value of <span

0 commit comments

Comments
 (0)