html - IE 8 兼容模式下的边框折叠问题

标签 html css internet-explorer internet-explorer-8 ie8-compatibility-mode

我需要显示一个第一行带下划线的表格。

为此,我设置了 border-collapse 并仅为第一行设置了边框。

它在 IE 7 和 FF 中运行良好。但在 IE 8(兼容模式)下,底部边框被打破。

查看此 fiddle

<table style = "border-collapse:collapse;" width="90%" 
    cellpadding="1" cellspacing="1">

<tbody>
<tr>

<th align="left" style="border-top:0px; border-left:0px; border-right:0px; 
    border-bottom:1px solid #838584;">Text1</th>
<th align="right" style="border-top:0px; border-left:0px; border-right:0px; 
    border-bottom:1px solid #838584;">Text2</th>
<th align="right" style="border-top:0px; border-left:0px; border-right:0px; 
    border-bottom:1px solid #838584;">Text3</th>

</tr>
</tbody>
</table>

注意:我尝试在我的 HTML 中给出 !DOCTYPE,如下所示。但是,当时页面本身并没有在 IE 8(兼容模式)中呈现。它仍然在 IE7 和 FF 中按预期工作

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

此外,在 IE 8 标准模式下一切正常

最佳答案

我在 Firefox 9、IE7 和 IE8(只测试了这些浏览器)中看不到表格之间的任何区别。您是否在标准模式下使用 IE8?边框仅在 IE8 标准模式下是实心的。在 IE8 上以 IE7 标准或怪癖模式运行将打破单元格结束/开始的边界。

您可能想查看 this post关于如何强制 IE8 在标准模式下运行或在 IE8 中按 F12 以在 IE 开发人员工具中检查您当前的模式

关于html - IE 8 兼容模式下的边框折叠问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9240772/

相关文章:

javascript - 如何将字符串保存到 p5.js 中的特定位置

jquery - 我正在使用 cakephp 并想知道如何使管理员 session 过期

javascript - 响应式 CSS 图像窗帘效果

javascript - rotateY(90deg)时如何让div不消失

windows - WebBrowser ActiveX 控件在 2022 年 6 月之后会继续工作吗?

html - "../"和 "~/"相对路径的区别

javascript - 为什么只能调整我最近添加的页面元素的大小?

css - -webkit-border-radius 在 Chrome 版本 44.0.2403.89 m 中不起作用

IE(9+) 中的 Angular 2+ 问题

internet-explorer - Selenium IE 更改事件未触发