YouTip LogoYouTip

Xslfo Blocks

* * * XSL-FO output resides within block areas. * * * ## XSL-FO Pages, Flows, and Blocks Content "blocks" are "flowed" into "pages", then output to the medium. XSL-FO output is typically nested inside an `` element, which is nested inside an `` element, which in turn is nested inside an `` element: * * * ## Block Area Properties A block is a sequence of output placed within a rectangular box: 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 * margin * border * padding ![Image 1: Content Margins and Padding](#) **space before** and **space after** are blank spaces separating blocks from each other. **margin** is the blank space outside the block. **border** is a rectangular outline at the outer edge of the area. Its four sides may each have different widths. It may also be filled with different colors and background images. **padding** is the area between the border and the content area. The **content** area may contain actual content, such as text, images, graphics, etc. * * * ## Block Margin * margin * margin-top * margin-bottom * margin-left * margin-right * * * ## Block Border Border style properties: * border-style * border-before-style * border-after-style * border-start-style * border-end-style * border-top-style (equivalent to border-before) * border-bottom-style (equivalent to border-after) * border-left-style (equivalent to border-start) * border-right-style (equivalent to border-end) Border color properties: * border-color * border-before-color * border-after-color * border-start-color * border-end-color * border-top-color (equivalent to border-before) * border-bottom-color (equivalent to border-after) * border-left-color (equivalent to border-start) * border-right-color (equivalent to border-end) Border width properties: * border-width * border-before-width * border-after-width * border-start-width * border-end-width * border-top-width (equivalent to border-before) * border-bottom-width (equivalent to border-after) * border-left-width (equivalent to border-start) * border-right-width (equivalent to border-end) * * * ## Block Padding * padding * padding-before * padding-after * padding-start * padding-end * padding-top (equivalent to padding-before) * padding-bottom (equivalent to padding-after) * padding-left (equivalent to padding-start) * padding-right (equivalent to padding-end) * * * ## Block Background * background-color * background-image * background-repeat * background-attachment (scroll or fixed) * * * ## Block Styling Attributes A block is a sequence of output that can be styled individually: This block of output will be written in a 12pt sans-serif font. Font properties: * font-family * font-weight * font-style * font-size * font-variant Text properties: * text-align * text-align-last * text-indent * start-indent * end-indent * wrap-option (defines line wrapping) * break-before (defines page breaks) * break-after (defines page breaks) * reference-orientation (defines text rotation in 90Β° increments) * * * ## Example At you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. Result: At you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP. Please examine the above example: generating a document containing numerous headings and paragraphs would require a great deal of code. Typically, XSL-FO documents do not combine formatting information and content as we just demonstrated. With a bit of help from XSLT, we can place formatting information into templates and thereby write cleaner content. You will learn later in this tutorial how to use XSLT templates to compose XSL-FO.
← Xslfo ListsXslfo Pages β†’