XML technologies / XSL-FO / Reference / Attributes in XSL-FO / padding-before.length
(Excerpt from "XSL-FO ― Die Referenz" by Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Recommendation section: 7.8.31
Category: 7.8 Common Border, Padding and Background Properties
Description
Padding is the space inside an area: the distance from the content to the border. (The border need not be visible.) An element can have a padding-before.length attribute specifying the space to the top border, depending on the writing direction selected by writing-mode. With lr-tb (within lines: left to right; lines: top to bottom) and rl-tb (within lines: right to left; lines: top to bottom), padding-before.length remains the space to the top border. With tb-rl (within columns: top to bottom; columns: right to left), it refers to the space to the left border. It therefore always concerns the border parallel to the line or column that closes the area.
Values
Length | A length consisting of a number and a unit. Common units are mm, pt, px, cm and pc. |
Default value: 0pt
XSL-FO version: 1.0
Allowed in:
<fo:basic-link> , <fo:block> , <fo:block-container> , <fo:character> , <fo:external-graphic> , <fo:initial-property-set> , <fo:inline> , <fo:inline-container> , <fo:instream-foreign-object> , <fo:leader> , <fo:list-block> , <fo:list-item> , <fo:page-number> , <fo:page-number-citation> , <fo:page-number-citation-last> , <fo:region-after> , <fo:region-before> , <fo:region-body> , <fo:region-end> , <fo:region-start> , <fo:scaling-value-citation> , <fo:table> , <fo:table-and-caption> , <fo:table-body> , <fo:table-caption> , <fo:table-cell> , <fo:table-column> , <fo:table-footer> , <fo:table-header> , <fo:table-row> and <fo:title>
Support:
Conformance level | Antenna House | FOP | RenderX XEP | Altsoft XML2PDF | Compart DocBridge |
Basic | Y | Y | Y | Y | Y |
XSL-FO example:
<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
0mm" page-height="210mm" page-width="148mm">
<fo:region-body margin="15mm 35mm 30mm
45mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:block-container writing-mode="lr-tb">
<fo:block margin="1pt" padding-before.length="50pt" border-color="black" border-width="1pt" border-style="solid">
»Was ist mit mir geschehen?«, dachte er. Es war kein Traum. Sein Zimmer, ein
richtiges, nur etwas zu kleines Menschenzimmer, lag ruhig zwischen den vier
wohlbekannten Wänden. Über dem Tisch, auf dem eine auseinandergepackte
Musterkollektion von Tuchwaren ausgebreitet war - Samsa war Reisender - hing das
Bild, das er vor kurzem aus einer illustrierten Zeitschrift ausgeschnitten und in
einem hübschen, vergoldeten Rahmen untergebracht hatte. Es stellte eine Dame dar,
die mit einem Pelzhut und einer Pelzboa versehen, aufrecht dasaß und einen schweren
Pelzmuff, in dem ihr ganzer Unterarm verschwunden war, dem Beschauer
entgegenhob.Gregors Blick richtete sich dann zum Fenster, und das trübe Wetter - man
hörte Regentropfen auf das Fensterblech aufschlagen - machte ihn ganz
melancholisch.
</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>In the output:
Excerpt from the W3C Recommendation: