Setting absolutely positioned element top/left in Mozilla

H

Hoss

Hello. I have the following markup and code:

<table cellspacing="0" cellpadding="0" id="area1">
// innards
</table>
<table cellspacing="0" cellpadding="0" id="overlay">
// innards
</table>

-- CSS styling these tables
table#area1
{
width:500px;
height:500px;
}
table#overlay
{
width:500px;
height:500px;
}

--javascript that executes onload
// Determine the top and left of area1
document.getElementById("overlay").style.top = top
document.getElementById("overlay").style.left = left

No DOCTYPE

Now- the foregoing works wonderfully in Internet Explorer. However in
Firefox the element that I am positioning - overlay - is ending up
about 9 pixels to the left of where it should be - directly on top of
area1. The code that is determining where it should go is working fine
- top and left are being calculated correctly. However- after I set the
style.left property of the overlay, if I then use javascript to read
that value, it is about 9 pixels off.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top