XML technologies / XSL-FO / Reference / Attributes in XSL-FO / top

(Excerpt from "XSL-FO ― Die Referenz" by 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

Recommendation section: 7.6.2

Recommendation section: 7.13.1

Category: 7.6 Common Absolute Position Properties

Category: 7.13 Common Relative Position Properties

Description

This attribute sets the distance of a positioned object (<fo:block-container>) from the top edge of its immediate parent block area.

Values

percentage

The top edge of a positioned object can be positioned relative to the top edge of its parent by a number (possibly negative or decimal) followed by the percent sign (%).

length

The top edge of a positioned object can be fixed at an absolute distance (length) from the top edge of its parent block area. The value must be a number (possibly negative or decimal) followed by a unit (em, ex, px, pt, in, cm, mm, pc).

auto

The distance of the positioned object from the top edge of its immediate parent block area is calculated automatically or left to the renderer.

Inherited:

yes

Default value: auto

XSL-FO version: 1.0

Allowed in:

<fo:basic-link> , <fo:bidi-override> , <fo:block> , <fo:block-container> , <fo:character> , <fo:external-graphic> , <fo:initial-property-set> , <fo:inline> , <fo:inline-container> , <fo:instream-foreign-object> , <fo:leader> , <fo:list-block> , <fo:list-item> , <fo:page-number> , <fo:page-number-citation> , <fo:page-number-citation-last> , <fo:scaling-value-citation> , <fo:table> , <fo:table-and-caption> , <fo:table-body> , <fo:table-caption> , <fo:table-cell> , <fo:table-footer> , <fo:table-header> and <fo:table-row>

Support:

7.6.2

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

7.13.1

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

XSL-FO example:

<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" 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">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
                      0mm" page-height="297mm" page-width="210mm">
<fo:region-body margin="0mm 0mm 0mm
                      0mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:block-container background-color="#F38222" absolute-position="fixed" top="100mm" width="50mm" height="50mm">
<fo:block text-align="center" vertical-align="middle" padding-top="21.5mm">
top="50mm"
<fo:block font-size="70%">
 width="50mm" height="50mm"
</fo:block>
</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>

Download the examples

In the output:

Excerpt from the W3C Recommendation:

More information online about

Property description in the CSS reference "top"

Rendering of the property in the XSL-FO reference

back to top