You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jo...@inventivedesigners.com on 2002/02/18 13:35:08 UTC

Question about position="relative"

Hi,

For a long while now, I'm trying to find an example or more information
about the use of property 'position="relative"'.
According to the "docs/html-docs/implemented.html" that comes with the
FOP-0.20.3 distribution, this property must be implemented.
What I'm trying to do is to position a block-container relative to a
preceding block-container:

<fo:block-container ...>
...
</fo:block-container>
<fo:block-container position="relative" top="100pt" left="100pt" ...>
...
</fo:block-container>

However, the second block-container is not positioned relative (= with
100pt offset to the left and the top) to the preceding one.
The second block-container is positioned at the bottom of the page, with a
100pt offset to the left and to the bottom. It seems as if the 'position
="relative"' property is ignored. I searched the fop-dev and fop-user
databases, but I found no answers there. Could someone please help with an
explanantion or a (working) example?



Joke Dehond
System Programmer & Designer
Inventive Designers n.v.
joke_dehond@inventivedesigners.com


Re: Question about position="relative"

Posted by Josh Campbell <jo...@zype.co.nz>.
>
>
>However, the second block-container is not positioned relative (= with
>100pt offset to the left and the top) to the preceding one.
>The second block-container is positioned at the bottom of the page, with a
>100pt offset to the left and to the bottom. It seems as if the 'position
>="relative"' property is ignored.
>

In Cascading Style Sheet layouts the position:relative attribute means 
the element is positioned relative to it's static position (ie. the 
position it would appear without the CSS turned on).

{ position:relative; top:100pt; left:100pt; } would move the element 
100pt from the top and 100pt from the left of it's static position. ie. 
down and right 100pt.

In your example, assuming .fo uses similar rules, I'm guessing your 
block container is appearing 100pt down and to the right of where it 
would appear without the top and left attributes.

You could either change these to position the element where you want it, 
use a position="absolute" (if it's supported in .fo), or use a table 
layout to position the element.

Hope this helps,
Josh


ZYPE - Graphical Interface Design
Phone: 03 3862094
Mobile: 021 400 472
Web: www.zype.co.nz