
January 24th, 2001, 10:26 AM
|
|
Junior Member
|
|
Join Date: Jan 2001
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Hi,
I'm trying to setup a page on which the content is centered both horizontally and vertically. My approach:
I use one table, set to 100% width and height and inside of it another one-cell table set to a fixed width and height. This centers the entire content of the page.
Now, within that centered cell, I need to use DIV's as well. Below code works for me in NS (i.e. the DIV's stay aligned with the background image) but in IE, the DIV's shift vertically on resize.
Here's the code:
<div id="container" style="position:absolute; align=center; height:100%; width:100%">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td width="100%" height="100%">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="750" height="479">
<tr>
<td background="images/bg.png">
<div id="box1" style="position: relative; left: 40px; top: -60px;">
<img src="images/nav1.gif" width="50" height="12"></div>
<div id="box2" style="position: relative; left: 100px; top: -72px;">
<img src="images/nav2.gif" width="50" height="12"></div>
<div id="box3" style="position: relative; left: 160px; top: -84px;">
<img src="images/nav3.gif" width="50" height="12"></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</center>
</div>
As far as I understand this has to do with IE's bug when using a combination of tables and relative positioning. Wonder if anyone knows a workaround WITHOUT!!! extensive JavaScript. I know it can be done with JS, but it's a rather dirty hack ...
Any help greatly appreciated.
Thanks
Diego
|