I've got a problem that requires rendering DIVs at different offset
locations, and while I've got a solution that works, the absolute
positioning is working to the client window, not to the parent
container.
The stuff I write will get placed inside a table cell produce by
someone else's template -- I have no control other than to emit
HTML/CSS within that sole cell.
So, I decided to construct a simple case and am having problems getting
that to render.
The goal, make a three by three table, and in the center cell do test
positions at the upper right, lower left, and center. Here's code that
I hoped did that.
<TABLE WIDTH="100%" HEIGHT="100%" BORDER=1>
<TR><TD>  ;</TD><TD> </TD><TD> </TD></TR>
<TR>
<TD> </TD>
<TD STYLE="border: thick solid green;">
<div style="width:10 0px; height:100px; position: absolute; top: 0%;
left: 100%; background-color: yellow;">
Upper right
</div>
<DIV STYLE="width:10 0px; height:100px; position: absolute; top: 100%
left: 0%; background-color: yellow;">
Bottom Left
</DIV>
<DIV STYLE="width:10 0px; height:100px; position: absolute; top: 50%
left: 50%; background-color: yellow;">
Center
</DIV>
</TD>
<TD> </TD>
</TR>
<TR><TD>  ;</TD><TD> </TD><TD> </TD></TR>
</TABLE>
It doesn't.
[color=blue]
>From what I can tell, absolute positions are from the client window,[/color]
and relative positions are from the last thing dropped on the page.
What I need is relative to the parent container.
The actual problem require computated things like 37% over and 82% down
where the DIVs contain arbitrarily sized content and deliberately
overlap, so I can't fudge a solution to this lone test case.
Any CSS wizard know how to accomplish something like this?
locations, and while I've got a solution that works, the absolute
positioning is working to the client window, not to the parent
container.
The stuff I write will get placed inside a table cell produce by
someone else's template -- I have no control other than to emit
HTML/CSS within that sole cell.
So, I decided to construct a simple case and am having problems getting
that to render.
The goal, make a three by three table, and in the center cell do test
positions at the upper right, lower left, and center. Here's code that
I hoped did that.
<TABLE WIDTH="100%" HEIGHT="100%" BORDER=1>
<TR><TD>  ;</TD><TD> </TD><TD> </TD></TR>
<TR>
<TD> </TD>
<TD STYLE="border: thick solid green;">
<div style="width:10 0px; height:100px; position: absolute; top: 0%;
left: 100%; background-color: yellow;">
Upper right
</div>
<DIV STYLE="width:10 0px; height:100px; position: absolute; top: 100%
left: 0%; background-color: yellow;">
Bottom Left
</DIV>
<DIV STYLE="width:10 0px; height:100px; position: absolute; top: 50%
left: 50%; background-color: yellow;">
Center
</DIV>
</TD>
<TD> </TD>
</TR>
<TR><TD>  ;</TD><TD> </TD><TD> </TD></TR>
</TABLE>
It doesn't.
[color=blue]
>From what I can tell, absolute positions are from the client window,[/color]
and relative positions are from the last thing dropped on the page.
What I need is relative to the parent container.
The actual problem require computated things like 37% over and 82% down
where the DIVs contain arbitrarily sized content and deliberately
overlap, so I can't fudge a solution to this lone test case.
Any CSS wizard know how to accomplish something like this?
Comment