ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > XSL FO > General > Setting spaces before and after block elements

Rendered image | PDF document
Set the space before a block element using the space-before.


Source
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" >
     <fo:layout-master-set>
          <fo:simple-page-master master-name="simple">
               <fo:region-body/>
          </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-reference="simple">
          <fo:flow flow-name="xsl-region-body">
               <fo:block> aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa </fo:block>
               <fo:block space-before="10pt"> Block, space-before is 10pt. bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb </fo:block>
               <fo:block space-before="30pt"> Block, space-before is 30pt. bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb </fo:block>
          </fo:flow>
     </fo:page-sequence>
</fo:root>