IE 8问题无法识别选择器

时间:2012-11-05 21:33:37

标签: css internet-explorer-8

我不知道为什么IE 8无法识别这个选择器“* =”

这是我用于网站的文档类型:

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

选择器适用于除IE 8之外的所有浏览器 - 任何建议?

这是完整的选择器:

.contourErrorMsg[style*="display: inline;"],
.contourErrorMsg[style*="display:inline;"] {
    display: block !important;
}

1 个答案:

答案 0 :(得分:1)

如果没有标记或JSfiddle证明问题,很难确定是什么导致了您的问题。 IE8 does support the substring attribute selector (` [*=]')

可能是你的文档中存在其他,这使得IE8处于怪异模式;在这种情况下,IE8不支持此选择器。

也许你错过了display:none末尾的分号。 (参见http://jsfiddle.net/vKCU3/。)该选择器匹配属性中的实际字符,而不是渲染的显示样式,因此这些小的东西会有所不同。

尝试从选择器中删除字符,直到看到匹配项,即I.E。:

.contourErrorMsg[style*="display"]
{ color: red; }

还要确保.contourErrorMsg是正确的类。

相关问题