如何在IE11上显示HOVER属性

时间:2019-01-18 07:35:40

标签: html css

我正在表上设置:hover属性以更改悬停时的行颜色。在CHROME和EDGE上工作正常,但在IE 11上却无法正常工作。

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>

<meta http-equiv='X-UA-Compatible' content='IE=9; IE=10; IE=11;IE=8; IE=7; IE=EDGE'/>

CSS部分:

tr.fullrow:hover{
    background:yellow;
    font-size:16px;
}

HTML部分:

<table border = "1" class ="tablewip">
    <caption> Assy WIP by Product </caption>
      <thead>
         <tr class ="headerrow">
         <td class="headercells" font-size:100px;  nowrap >'.$colHeader.'</td>
         </tr>
      </thead>
      <tbody>
         <tr class = "fullrow">
            <td  class = "wipcells" nowrap >Text </td>
         </tr>
      </tbody>
</table>

堆栈片段

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
  <meta http-equiv='X-UA-Compatible' content='IE=9; IE=10; IE=11;IE=8; IE=7; IE=EDGE' />
  <style>
    tr.fullrow:hover {
      background: yellow;
      font-size: 16px;
    }
  </style>
</head>

<body>
  <table border="1" class="tablewip">
    <caption> Assy WIP by Product </caption>
    <thead>
      <tr class="headerrow">
        <td class="headercells" font-size:100px; nowrap>'.$colHeader.'</td>
      </tr>
    </thead>
    <tbody>
      <tr class="fullrow">
        <td class="wipcells" nowrap>Text </td>
      </tr>
    </tbody>
  </table>
</body>
</html>

2 个答案:

答案 0 :(得分:-2)

对于CSS部分,请尝试以下操作:

{{1}}

请参见以下示例:https://codepen.io/pjamourik/pen/EGBgEy

答案 1 :(得分:-2)

我将样式设置为 td 而不是 tr 。例如:

tr.fullrow:hover td{
    background:yellow;
    font-size:16px;
}