Image alignment

In addition to image scaling you can alter the position of the graphic. The imagedata element accepts a align attribute to position the image horizontally. It takes a value of left, center, or right. The alignment is relative to the viewport area, which may be less than the whole page if you specify a width attribute. You can also use a valign attribute to position the graphic vertically within the viewport area. It takes a value of top, middle, or bottom.

If you want all your images to be centered in HTML output without having to set the align attribute, then you should add a selector to your CSS for the class="mediaobject" attribute that appears on each mediaobject's div wrapper. Then you can specify alignment and other formatting properties in your cascading stylesheet.

If you want all your images centered in XSL-FO output, there is no parameter or attribute-set that will center all mediaobject elements. However, if you put each of your mediaobject elements inside informalfigure, you can center those using:

<xsl:attribute-set name="informalfigure.properties">
  <xsl:attribute name="text-align">center</xsl:attribute>
</xsl:attribute-set>