简体   繁体   English

无法覆盖“边框折叠”的 CSS 值,IE7 开发人员工具似乎具有误导性

[英]Unable to override CSS value for 'border-collapse', IE7 Developer Tool seems misleading

The web-page I'm authoring has a TABLE in it.我正在创作的网页中有一个表格。 The TABLE's border-collapse property is being set by a 3rd party CSS file that I import to be 'collapse'. TABLE 的边框折叠属性由我导入的第 3 方 CSS 文件设置为“折叠”。

When I open the page in IE7, I notice that the table doesn't look right (the borders of the cells are visible as white lines).当我在 IE7 中打开页面时,我注意到表格看起来不正确(单元格的边框显示为白线)。

Using IE's Developer Tool, I can enable/disable the 'border-collapse:collapse' attribute of the CSS I'm including using the check-box next to it in the Developer Tool's UI.使用 IE 的开发人员工具,我可以启用/禁用我包含的 CSS 的“border-collapse:collapse”属性,在开发人员工具的 UI 中使用它旁边的复选框。

When I unchecked the box, the TABLE looks right again (no borders visible).当我取消选中该框时,TABLE 看起来又正确了(无边框可见)。 So, I thought that if I put an inline style on the table element, setting the property value to 'separate' that would override the CSS file's value and the table would look right.所以,我认为如果我在 table 元素上放置一个内联样式,将属性值设置为 'separate' 将覆盖 CSS 文件的值,并且表格看起来会正确。

When I add the inline style to the TABLE however, it doesn't affect it's appearance.但是,当我将内联样式添加到 TABLE 时,它不会影响它的外观。 In the Developer Tool, I see that now the 'border-collapse:collapse' attribute of the CSS has 'strikethrough' style ie: it looks to be ;crossed out', but it seems like it is still being applied, because if I uncheck/check the box next to it, it still toggles the visibility of the cell borders.在开发人员工具中,我看到现在 CSS 的 'border-collapse:collapse' 属性具有 'strikethrough' 样式,即:它看起来被划掉了',但它似乎仍在应用,因为如果我取消选中/选中它旁边的框,它仍然会切换单元格边框的可见性。

My questions are: shouldn't the inline-style value be overriding the CSS-imported value for this attribute?我的问题是:内联样式值不应该覆盖此属性的 CSS 导入值吗? Why does the attribute from the CSS appear crossed-out in the Developer Tool but is apparently not disabled?为什么来自 CSS 的属性在 Developer Tool 中出现划掉但显然没有被禁用? Is there some other way I can prevent the CSS value from being applied to border-collapse for this table?有没有其他方法可以防止将 CSS 值应用于此表的边框折叠?

Thanks,谢谢,

NB: I also tried adding '!important' after 'separate'注意:我也尝试在 'separate' 之后添加 '!important'

Yes, an in-line style specification would override (have a higher specificity) than a style coming from an imported stylesheet.是的,与来自导入样式表的样式相比,内嵌样式规范会覆盖(具有更高的特异性)。 But that could be overridden by a JS-applied style.但这可能会被 JS 应用的样式覆盖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM