views:

32

answers:

1

Hi,

I have this textarea (it's expaned, after clicking on a specific button) which is supposed to be over that text-inputfield. In FF and Chrome, it's working. But not in IE(6+7). Does anyone have a clue, where the problem is and how I could solve it?

<html>
<head>
<style type="text/css">
.Tbl { width: 100%; }
.Col1 { width: 10%; }
.Col2 { width: 90%; }

.CellTA { background-color: #00F; vertical-align: top; padding: 5px; }
.DivTA { position: relative; }
.DivTA2 { position: absolute; background-color: #FF0; padding: 5px; }
.TA { position: relative; z-Index: 10; height: 50px; width: 200px; }

.CellInp { background-color: #F0F; padding: 5px; }
.DivInp { position: relative; width: 100%; background-color: #0F0; }
.Inp { position: relative; width: 200px; }
</style>
</head>
<body>
<table class="Tbl">
  <colgroup>
    <col class="Col1" />
    <col class="Col2" />
  </colgroup>
  <tr>
    <td>Ref</td>
    <td class="CellTA">
      <div class="DivTA">
        <div class="DivTA2">
          <textarea class="TA"></textarea>
        </div>
      </div>
    </td>
  </tr>
  <tr>
    <td>eMail</td>
    <td class="CellInp">
      <div class="DivInp">
        <input type="text" class="Inp">
      </div>
    </td>
  </tr>
</table>
</body>
</html>

Thanks in advance

EDIT: Added padding and changed the background-color of DivTA2

+1  A: 

IE treats z-index a bit differently than other browsers. These blog entry might be helpful to you:

http://annevankesteren.nl/2005/06/z-index

http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

In short, I think you may need to add a z-index to the parent element of the one that has it. (I'm not totally sure if adding it one level up will do -- if that doesn't work you could try adding it to the grandparent element as well.)

Tim Goodman
That's the solution! You made my day ;). Thanks!
Prjio
@Prjio: Glad I could help :)
Tim Goodman