axf:float-reference
(Auszug aus "XSL-FO ― Die Referenz" von 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
Category Float Extension Properties >> axf:float-y / CSS -ah-float-y
Specifies reference area where the float is placed.
Value: | auto | normal | page | column | multicol |
Initial: | auto |
Applies to: | fo:float / floated elements |
Inherited: | no |
Percentages: | N/A |
Values have the following meanings.
auto | Same as normal. However, when float-y is none in CSS, the float positioning is affected by block indents where the block contains the float anchor. |
normal | The float is placed in the current reference area. |
page | The float is placed in the page area (region-body). |
column | The float is placed in the column area. |
multicol | The float is placed in the multi-column area. |
When float-y is none, the reference area in x-axis will be set.
When using with CSS, if float-y is none and the float-reference is auto the float positioning is affected by block indents where the block contains the float anchor, but by specifying normal, page, or column, it is possible to position floats regardless of the block indents.
XSL-FO sample:
| <fo:root xml:lang="en" 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"> | |
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| Antenna House, Inc. | |
| ||
| </fo:block> | |
| ||
| ||
| ||
| ||
| Page float settings | |
| </fo:block> | |
| </fo:block> | |
| ||
| AH Formatter extends the float feature to arrange the float in any positions on the page or arrange it across multiple columns. The reference area where the float is arranged can be specified by axf:float-reference, available values are auto, normal, page, multicol and column. Specify axf:float-x for arranging the float in horizontal direction, specify axf:float-y in vertical direction. This sample shows the page float specified by axf:float-reference="page". | |
| </fo:block> | |
| ||
| You can also use the shorthand property, axf:float, to specify the float-related extended properties at once. The following shows the same result but the different approach of using individual properties and using shorthand property. | |
| </fo:block> | |
| <fo:block> | |
| Using individual extended properties (Arrange the float on top of the page.) | |
| </fo:block> | |
| ||
| <fo:float axf:float-reference="page" axf:float-x="none" axf:float-y="top"> | |
| </fo:block> | |
| <fo:block> | |
| Using the shorthand property (Arrange the float on top of the page.) | |
| </fo:block> | |
| <fo:block> | |
| <fo:float axf:float="page top"> | |
| </fo:block> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="none" axf:float-y="top"> (Arrange the float on top of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="right" axf:float-y="top"> (Arrange the float on the upper right of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="left" axf:float-y="bottom"> (Arrange the float on the upper right of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="outside" axf:float-y="center"> (Arrange the float outside of the page, center of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="inside" axf:float-y="center"> (Arrange the float inside of the page, center of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| ||
| ||
| <fo:block> | |
| <fo:float axf:float-reference="page" axf:float-x="none" axf:float-y="bottom"> (Arrange the float at the bottom of the page.) | |
| </fo:block> | |
| ||
| </fo:float> | |
| </fo:flow> | |
| ||
| </fo:root> |
Output:
Tipp der data2type-Redaktion: Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: |