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

标签 html css

我在 table 中将 box-shadow 赋予 tr 它在所有浏览器中都工作正常,但在 IE- 10 它在所有 td 中显示 box-shadow,为什么?

tr {
  box-shadow: 2px 0 0px #888 inset;
}
<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>

Chrome

enter image description here

IE 10

enter image description here

注意:我不能使用border,所以我给了box-shadow

最佳答案

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

tr th:first-child, tr td:first-child {
  box-shadow: 2px 0 0px #888 inset;
}
<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>

关于html - Box-shadow 出现在 IE 的所有列中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41695845/

相关文章:

python - 将代码转换为语法突出显示的 html

javascript - 多语言无法在本地运行,但 codepen 运行良好

css - 如何将两个 Bootstrap 输入组放在同一行?

html - CSS:无法消除内联列表上的空间

html - HTML anchor 标记中超链接文本的内联换行

jquery - CSS 中相邻的两个类

javascript - jQuery 额外的 Ghost div?需要删除功能?

html - 响应式设计的 Bootstrap - 嵌套列的堆叠

javascript - 如何禁用多个滚动功能?

对父颜色透明的CSS