css - 为什么我的 *+html CSS 在 IE7 中工作

标签 css internet-explorer css-selectors

我正在使用 IE7 的特殊选择器 *+html 对 IE7 进行一些改编:-)

这是在 chrome 中显示的 CSS 代码...我确实不想看到它,除了 IE7:

*+html .container, .ui-listview {
position: relative;
top: 41px;
}

我将其他 css 与 *+html 一起使用,它只能由 IE7 读取,但下面的 css

感谢帮助我!

最佳答案

您正在使用 grouping operator :

When several selectors share the same declarations, they may be grouped into a comma-separated list.

In this example, we condense three rules with identical declarations into one. Thus,

h1 { font-family: sans-serif }
h2 { font-family: sans-serif }
h3 { font-family: sans-serif }

is equivalent to:

h1, h2, h3 { font-family: sans-serif }

所以这段代码:

*+html .container, .ui-listview {
    position: relative;
    top: 41px;
}

...等同于:

*+html .container{
    position: relative;
    top: 41px;
}
.ui-listview {
    position: relative;
    top: 41px;
}

这解释了 .ui-listview 不受 *+html 的影响。

关于css - 为什么我的 *+html CSS 在 IE7 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18231960/

相关文章:

javascript - 如何使用CSS伪元素限制字符?

javascript - 选择未包含在特定元素中的所有元素

jquery - 将类添加到仅包含子元素的元素

json - 动态 365 CRM : Sudden JS Error

CSS 选择器不是元素类型的子元素?

jquery - IE 9 textarea 换行问题

javascript - 使用 javascript 在 Internet Explorer 中迭代 formData 对象

android - 个人电脑、平板电脑、iPhone、iPad、纵向和横向文本问题

html - 防止html h2标签被高亮显示

点击后html链接标签颜色不变