开发者

IE ignoring zIndex

开发者 https://www.devze.com 2023-01-16 11:00 出处:网络
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 clu

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


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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消