Box-shadow出现在IE的所有列中

Abh*_*dey 8 html css css3

我给box-shadowtrtable它的正常工作在所有浏览器,但IE-10它显示box-shadow在所有的td,为什么呢?

tr {
  box-shadow: 2px 0 0px #888 inset;
}
Run Code Online (Sandbox Code Playgroud)
<table border=0 cellsapcing=0 cellpadding=6>
  <tr>
    <th>Column</th>
    <th>Column</th>
    <th>Column</th>
    <th>Column</th>
  </tr>
  <tr>
    <td>Column</td>
    <td>Column</td>
    <td>Column</td>
    <td>Column</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

IE 10

在此输入图像描述

注意:我不能使用border这就是我给的原因box-shadow

Tom*_*Tom 6

我采取了一些不同的方法,并将框阴影分配给第一个thtd元素.这个解决方案围绕问题而不是解决问题 - 但我觉得这样有效.

tr th:first-child, tr td:first-child {
  box-shadow: 2px 0 0px #888 inset;
}
Run Code Online (Sandbox Code Playgroud)
<table border=0 cellsapcing=0 cellpadding=6>
  <tr>
    <th>Column</th>
    <th>Column</th>
    <th>Column</th>
    <th>Column</th>
  </tr>
  <tr>
    <td>Column</td>
    <td>Column</td>
    <td>Column</td>
    <td>Column</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

  • 因为IE ...;) (2认同)