是否可以为组合类设置CSS? [英] Is it possible to set CSS for combined classes?

查看:115
本文介绍了是否可以为组合类设置CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有以下:

tr {
    background: #fff;
}

tr.even {
    background: #eee
}

tr.highlight {
    background: #fec;
}

可以指定第4个背景( fea )而不是高亮显示只是覆盖甚至

Is it possible to specify a 4th background (#fea) instead of having highlight simply overwrite even?

<tr class="even highlight">
  <!-- ... -->
</tr>






一旦支持CSS3,:nth-​​child 可能会工作。但是,在此期间可用的任何内容?


Once CSS3 is supported, :nth-child might work. But, anything available in the meantime?

tr { /* ... */ }

tr:nth-child(even) { /* ... */ }

tr.highlight { /* ... */ }

tr.highlight:nth-child(even) { /* ... */ }


推荐答案

您可以这样做:

tr.even.highlight { ... }

不过IE6不知道。

这篇关于是否可以为组合类设置CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆