11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: box.src,v 1.7 1998-03-22 02:02:16 ijacobs Exp $ -->
3+ <!-- $Id: box.src,v 1.8 1998-03-23 02:39:56 bbos Exp $ -->
44<HEAD>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<TITLE>Box model</TITLE>
1212generated for elements in the <a href="conform.html#doctree">document
1313tree</a> and formatted by the <a href="visuren.html">visual rendering
1414model</a>. The <A href="page.html">page box</A> is a special kind of
15- box that is described in detail on the section on <A
15+ box that is described in detail in the section on <A
1616href="page.html">paged media</a>.
1717
1818<H2><a name="box-dimensions">Box dimensions</a></H2>
@@ -52,7 +52,7 @@ has 0 width, the padding edge is the same as the content edge.
5252The padding edge of a box defines the edges of the
5353<a href="visuren.html#containing-block">containing block</a> established by the box.
5454<dt><span class="index-def" title="border edge"><a name="border-edge"><strong>border edge</strong></a></span>
55- <dd>The border edge surrounds the box border. If the border
55+ <dd>The border edge surrounds the box's border. If the border
5656has 0 width, the border edge is the same as the padding edge.
5757<dt><span class="index-def" title="margin edge"><a name="margin-edge"><strong>margin edge</strong></a></span>
5858or <span class="index-def" title="outer edge"><a name="outer-edge"><strong>outer
@@ -151,7 +151,7 @@ and padding relate."></p>
151151
152152<li>The <a href="#content-width">content width</a> for each LI box is
153153calculated top-down; the <a href="visuren.html#containing-block">containing
154- block</a> for the each LI box is the box generated by the UL element.
154+ block</a> for each LI box is the box generated by the UL element.
155155
156156<li>The height of each LI box is given by its <a
157157href="#content-height">content height</a>, plus padding, borders, and
@@ -187,7 +187,7 @@ href="#box-margin-area">margin area</a> of a box. The
187187<span class="propinst-margin">'margin'</span> shorthand property sets
188188the margin for all four sides while the other margin properties only
189189set their respective side. These properties apply to all elements
190- generating <a href="visuren.html#block-box">block</a> boxes for which
190+ generating <a href="visuren.html#block-box">block</a> boxes and also if
191191<span class="propinst-display">'display'</span> is set to 'caption'.
192192
193193<P>The properties defined in this section refer to the <span
@@ -211,41 +211,12 @@ implementation-specific limits.
211211
212212<!-- #include src=properties/margin-top.srb -->
213213
214- <P>This property sets the top margin of a generated box.
214+ <P>These properties set the top, right, bottom, resp. left margin of a
215+ box.
215216
216217<div class="example"><P>
217218<PRE>
218- H1 { margin-top: 2em }
219- </PRE>
220- </div>
221-
222- <!-- #include src=properties/margin-right.srb -->
223-
224- <P>This property sets the right margin of a generated box.
225-
226- <div class="example"><p>
227- <PRE>
228- H1 { margin-right: 12.3% }
229- </PRE>
230- </div>
231-
232- <!-- #include src=properties/margin-bottom.srb -->
233-
234- <P> This property sets the bottom margin of a generated box.
235-
236- <div class="example"><P>
237- <PRE>
238- H1 { margin-bottom: 3px }
239- </PRE>
240- </div>
241-
242- <!-- #include src=properties/margin-left.srb -->
243-
244- <P> This property sets the left margin of a generated box.
245-
246- <div class="example"><P>
247- <PRE>
248- H1 { margin-left: 2em }
219+ H1 { margin-top: 2em }
249220</PRE>
250221</div>
251222
@@ -275,21 +246,21 @@ respectively.
275246
276247<div class="example"><P>
277248<PRE>
278- BODY { margin: 2em } /* all margins set to 2em */
279- BODY { margin: 1em 2em } /* top & bottom = 1em, right & left = 2em */
280- BODY { margin: 1em 2em 3em } /* top=1em, right=2em, bottom=3em, left=2em */
249+ BODY { margin: 2em } /* all margins set to 2em */
250+ BODY { margin: 1em 2em } /* top & bottom = 1em, right & left = 2em */
251+ BODY { margin: 1em 2em 3em } /* top=1em, right=2em, bottom=3em, left=2em */
281252</PRE>
282253
283254<P> The last rule of the example above is equivalent to the example
284255below:
285256
286257<PRE>
287- BODY {
288- margin-top: 1em;
289- margin-right: 2em;
290- margin-bottom: 3em;
291- margin-left: 2em; /* copied from opposite side (right) */
292- }
258+ BODY {
259+ margin-top: 1em;
260+ margin-right: 2em;
261+ margin-bottom: 3em;
262+ margin-left: 2em; /* copied from opposite side (right) */
263+ }
293264</PRE>
294265</div>
295266
@@ -338,7 +309,7 @@ borders</a> for an illustration of collapsed margins.
338309</H2>
339310
340311<P>The padding properties specify the width of the <a
341- href="#box-content -area">content area</a> of a box. The <span
312+ href="#box-padding -area">padding area</a> of a box. The <span
342313class="propinst-padding">'padding'</span> shorthand property sets the
343314padding for all four sides while the other padding properties only set
344315their respective side. These properties apply to all elements.
@@ -363,41 +334,12 @@ properties refer to the width of the generated box's containing block.
363334
364335<!-- #include src=properties/padding-top.srb -->
365336
366- <P> This property sets the top padding of a generated box.
367-
368- <div class="example"><P>
369- <PRE>
370- BLOCKQUOTE { padding-top: 0.3em }
371- </PRE>
372- </div>
373-
374- <!-- #include src=properties/padding-right.srb -->
375-
376- <P> This property sets the right padding of a generated box.
377-
378- <div class="example"><P>
379- <PRE>
380- BLOCKQUOTE { padding-right: 10px }
381- </PRE>
382- </div>
383-
384- <!-- #include src=properties/padding-bottom.srb -->
385-
386- <P> This property sets the bottom padding of a generated box.
387-
388- <div class="example"><P>
389- <PRE>
390- BLOCKQUOTE { padding-bottom: 2em }
391- </PRE>
392- </div>
393-
394- <!-- #include src=properties/padding-left.srb -->
395-
396- <P> This property sets the left padding of a generated box.
337+ <P>These properties set the top, right, bottom, resp. left padding of
338+ a box.
397339
398340<div class="example"><P>
399341<PRE>
400- BLOCKQUOTE { padding-left: 20% }
342+ BLOCKQUOTE { padding-top: 0.3em }
401343</PRE>
402344</div>
403345
@@ -425,10 +367,10 @@ the <span class="propinst-background">'background'</span> property:
425367
426368<div class="example"><P>
427369<PRE>
428- H1 {
429- background: white;
430- padding: 1em 2em;
431- }
370+ H1 {
371+ background: white;
372+ padding: 1em 2em;
373+ }
432374</PRE>
433375
434376<P> The example above specifies a '1em' vertical padding (<span
@@ -496,37 +438,8 @@ agent. The following relationships must hold, however:
496438
497439<!-- #include src=properties/border-top-width.srb -->
498440
499- <P> This property sets the width of the top border of a box.
500-
501- <div class="example"><P>
502- <PRE>
503- H1 { border: solid thick red }
504- P { border: solid thick blue }
505- </PRE>
506-
507- <P> In the example above, H1 and P elements will have the same
508- border width regardless of font size. To achieve relative widths, the
509- 'em' unit can be used:
510-
511- <PRE>
512- H1 { border: solid 0.5em }
513- </PRE>
514- </div>
515-
516- <!-- #include src=properties/border-right-width.srb -->
517-
518- <P> This property sets the width of the right
519- border of a box.
520-
521- <!-- #include src=properties/border-bottom-width.srb -->
522-
523- <P> This property sets the width of the bottom border of
524- a box.
525-
526- <!-- #include src=properties/border-left-width.srb -->
527-
528- <P> This property sets the width of the left border
529- of a box.
441+ <P>These properties set the width of the top, right, bottom,
442+ resp. left border of a box.
530443
531444<!-- #include src=properties/border-width.srb -->
532445
@@ -552,9 +465,9 @@ In the examples below, the comments indicate the resulting widths
552465of the top, right, bottom and left borders:
553466
554467<PRE>
555- H1 { border-width: thin } /* thin thin thin thin */
556- H1 { border-width: thin thick } /* thin thick thin thick */
557- H1 { border-width: thin thick medium } /* thin thick medium thick */
468+ H1 { border-width: thin } /* thin thin thin thin */
469+ H1 { border-width: thin thick } /* thin thick thin thick */
470+ H1 { border-width: thin thick medium } /* thin thick medium thick */
558471</PRE>
559472</div>
560473
@@ -569,9 +482,6 @@ of the top, right, bottom and left borders:
569482<P>The border color properties specify the color of a box's border.
570483
571484<!-- #include src=properties/border-top-color.srb -->
572- <!-- #include src=properties/border-right-color.srb -->
573- <!-- #include src=properties/border-bottom-color.srb -->
574- <!-- #include src=properties/border-left-color.srb -->
575485<!-- #include src=properties/border-color.srb -->
576486
577487<P>The <span class="propinst-border-color">'border-color'</span>
@@ -602,11 +512,11 @@ for the border color.
602512<div class="example">
603513<P>In this example, the border will be a solid black line.
604514<PRE>
605- P {
606- color: black;
607- background: white;
608- border: solid;
609- }
515+ P {
516+ color: black;
517+ background: white;
518+ border: solid;
519+ }
610520</PRE>
611521</div>
612522
@@ -670,9 +580,6 @@ interpret 'dotted', 'dashed', 'double', 'groove', 'ridge',
670580'inset', and 'outset' to be 'solid'.
671581
672582<!-- #include src=properties/border-top-style.srb -->
673- <!-- #include src=properties/border-right-style.srb -->
674- <!-- #include src=properties/border-bottom-style.srb -->
675- <!-- #include src=properties/border-left-style.srb -->
676583<!-- #include src=properties/border-style.srb -->
677584
678585<P> The <span class="propinst-border-style">'border-style'</span>
@@ -682,7 +589,7 @@ four values, and the values are set on the different sides as for
682589
683590<div class="example"><P>
684591<PRE>
685- #xy34 { border-style: solid dotted }
592+ #xy34 { border-style: solid dotted }
686593</PRE>
687594<P> In the above example, the horizontal borders will be 'solid' and
688595the vertical borders will be 'dotted'.
@@ -701,19 +608,19 @@ will be visible unless the border style is set.
701608<!-- #include src=properties/border-top.srb -->
702609
703610<P> This is a shorthand property for setting the width, style, and
704- color of the top border of a box.
611+ color of the top, right, bottom, resp. left border of a box.
705612
706613<div class="example"><P>
707614<PRE>
708- H1 { border-bottom: thick solid red }
615+ H1 { border-bottom: thick solid red }
709616</PRE>
710617
711618<P> The above rule will set the width, style, and color of the border
712619<strong>below</strong> the H1 element. Omitted values will be set to
713620their <a href="cascade.html#initial-value">initial values</a>:
714621
715622<PRE>
716- H1 { border-bottom: thick solid }
623+ H1 { border-bottom: thick solid }
717624</PRE>
718625<P> Since the color value is omitted in the above example, the border
719626color will be the same as the <span class="propinst-color">
@@ -724,24 +631,6 @@ color will be the same as the <span class="propinst-color">
724631class="propinst-border-style">'border-style'</span> property accepts
725632up to four values, this property only accepts one style value.
726633
727- <!-- #include src=properties/border-bottom.srb -->
728-
729- <P> This is a shorthand property for setting the width, style, and
730- color of the bottom border of a box. Otherwise, it behaves like <span
731- class="propinst-border-top">'border-top'</span>.
732-
733- <!-- #include src=properties/border-right.srb -->
734-
735- <P> This is a shorthand property for setting the width, style, and
736- color of the right border of a box. Otherwise, it behaves like <span
737- class="propinst-border-top">'border-top'</span>.
738-
739- <!-- #include src=properties/border-left.srb -->
740-
741- <P> This is a shorthand property for setting the width, style, and
742- color of the left border of a box. Otherwise, it behaves like <span
743- class="propinst-border-top">'border-top'</span>.
744-
745634<!-- #include src=properties/border.srb -->
746635
747636<P> The <span class="propinst-border">'border'</span> property is a
@@ -751,22 +640,20 @@ class="propinst-margin">'margin'</span> and <span
751640class="propinst-padding">'padding'</span> properties, the <span
752641class="propinst-border">'border'</span> property cannot set different
753642values on the four borders. To do so, one or more of the other border
754- properties must be used. Note that while the <span
755- class="propinst-border-width">'border-width'</span> property accepts
756- up to four length values, this property only accepts one.
643+ properties must be used.
757644
758645<div class="example"><P>
759646For example, the first rule below is
760647equivalent to the set of four rules shown after it:
761648
762649<PRE>
763- P { border: solid red }
764- P {
765- border-top: solid red;
766- border-right: solid red;
767- border-bottom: solid red;
768- border-left: solid red
769- }
650+ P { border: solid red }
651+ P {
652+ border-top: solid red;
653+ border-right: solid red;
654+ border-bottom: solid red;
655+ border-left: solid red
656+ }
770657</PRE>
771658</div>
772659
@@ -777,11 +664,11 @@ important.
777664<div class="example"><P>
778665Consider this example:
779666<PRE>
780- BLOCKQUOTE {
781- border-color: red;
782- border-left: double;
783- color: black
784- }
667+ BLOCKQUOTE {
668+ border-color: red;
669+ border-left: double;
670+ color: black
671+ }
785672</PRE>
786673
787674<P> In the above example, the color of the left border is black,
0 commit comments