XSL-FO output goes into blocks.
XSL-FO Pages, Flow, and Block
"Blocks" of content "Flow" into "Pages" of the output media.
XSL-FO output is normally nested inside <fo:block> elements, nested inside <fo:flow> elements, nested inside <fo:page-sequence> elements:
<!-- Output goes here -->
Block Area Attributes
Blocks are sequences of output in rectangular boxes:
This block of output will have a one millimeter border around it.
Since block areas are rectangular boxes, they share many common area properties:
- space before and space after
The space before and space after is the empty space separating the block from the other blocks.
The margin is the empty area on the outside of the block.
The border is the rectangle drawn around the external edge of the area. It can have different widths on all four sides. It can also
be filled with different colors and background images.
The padding is the area between the border and the content area.
The content area contains the actual content like text, pictures, graphics, or whatever.
Border style attributes:
- border-top-style (same as border-before)
- border-bottom-style (same as border-after)
- border-left-style (same as border-start)
- border-right-style (same as border-end)
Border color attributes:
- border-top-color (same as border-before)
- border-bottom-color (same as border-after)
- border-left-color (same as border-start)
- border-right-color (same as border-end)
Border width attributes:
- border-top-width (same as border-before)
- border-bottom-width (same as border-after)
- border-left-width (same as border-start)
- border-right-width (same as border-end)
- padding-top (same as padding-before)
- padding-bottom (same as padding-after)
- padding-left (same as padding-start)
- padding-right (same as padding-end)
- background-attachment (scroll or fixed)
Block Styling Attributes
Blocks are sequences of output that can be styled individually:
This block of output will be written in a 12pt sans-serif font.
- wrap-option (defines word wrap)
- break-before (defines page breaks)
- break-after (defines page breaks)
- reference-orientation (defines text rotation in 90" increments)
font-size="14pt" font-family="verdana" color="red"
At W3Schools you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
At W3Schools you will find all the Web-building
tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
When you look at the example above, you can see that it will take a lot of code to produce a document with many headers and paragraphs.
Normally XSL-FO document do not combine formatting information and content like we have done here.
With a little help from XSLT we can put the formatting information into templates and write a cleaner content.
You will learn more about how to combine XSL-FO with XSLT templates in a later chapter in this tutorial.
Thank You For Helping Us!
Your message has been sent to W3Schools.