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

All > XSL FO > Margins > cmpi-margin-inline1.fo


Title: cmpi-margin-inline1.fo
Origin: NIST XSL test suite

Rendered image | PDF output | FO file
ElementsAttributes
fo:blockbackground-color |
fo:flowflow-name |
fo:inlinebackground-color | margin-bottom | margin-left | margin-right | margin-top |
fo:layout-master-set
fo:page-sequencemaster-name |
fo:region-bodymargin-top |
fo:root
fo:simple-page-mastermaster-name | page-height | page-width |

Warning! These examples are related to XSL FO Working Draft, you need to use attribute "page-sequence/@master-reference" instead of "page-sequence/@master-name".


Source

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" >
     <fo:layout-master-set>
          <fo:simple-page-master master-name="test-page-master" page-width="8.5in" page-height="11in">
               <fo:region-body margin-top="0.4in"/>
          </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-name="test-page-master">
          <fo:flow flow-name="xsl-region-body">
               <fo:block background-color="gray"> This element is unstyled save for a background color of gray. However, it contains an
                    <fo:inline background-color="red" margin-bottom="25px" margin-left="25px" margin-top="25px" margin-right="25px">inline element of margin 25px and background-color of red, giving it a red background and a 25px margin</fo:inline>. Margins on inline elements do not affect line-height calculations, so all lines in this element should have the same line-height. However, there should be a 25px margin to the left side of the inline box in the first line it appears, and a 25px margin to the right side of the inline element box in the last line where it appears. Individual properties are tested here.
               </fo:block>
          </fo:flow>
     </fo:page-sequence>
</fo:root>



Sponsored links: Domain Names, answering service, VoIP Internettelefonie, DSL, SDSL, ADSL