Absolute positioning differences between browsers

I want to write text into a number of boxes on a web page.

I cannot tell in advance what the text length is, but I do not want the boxes to change size, so I thought I'd put the text on a layer using the 'hidden' attribute to trim the text if it gets to long,

I will have about 30 boxes with text in.

Below is a simplified version of the page illustrating my problem.   If I line the text with the box in IE, in Firefox it is out of line and visa versa

Can anyone explain why this happens and how I can correct it?

<html>
<head>
</head>

<body bgcolor="#FFFFFF">

<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:3; overflow: hidden; left: 100px; top: 206px">
  <p>Line one<br>
    Line 2<br>
    This Is in line for <br>
    Internet Explorer</p>
</div>
<table width="200" border="0" height="200" bgcolor="#FFFF00" style="position:absolute;left: 100px; top: 206px; z-index: 2; width: 200px; height: 85px">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:3; overflow: hidden; left: 350px; top: 193px">
  <p>Line one<br>
    Line 2<br>
    This Is in line for <br>
    FireFox</p>
</div>
<table width="200" border="0" height="200" bgcolor="#FFFF00" style="position:absolute;left: 350px; top: 206px; z-index: 2; width: 200px; height: 85px">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>


</body>
</html>
perrybondAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

markomniCommented:
Take your <p> </p> tags out of the DIV:

<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:3; overflow: hidden; left: 100px; top: 206px">
    Line one<br>
    Line 2<br>
    This Is in line for <br>
    Internet Explorer
</div>
<table width="200" border="0" height="200" bgcolor="#FFFF00" style="position:absolute;left: 100px; top: 206px; z-index: 2; width: 200px; height: 85px">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

When it renders the content, the <p> </p> tags cause Firefox to insert an extra line.  IE ignores the tags.  Alternately, you can just use a DIV without the table:

<div id="Layer2" style="position:absolute; width:200px; height:85px; overflow: hidden; left: 100px; top: 506px; background-color: #FFFF00">
    Line one<br>
    Line 2<br>
    This Is in line for <br>
    Internet Explorer
</div>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
markomniCommented:
Glad I could help you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.