[英]how to combine multiple css class selectors for jquery buttonset?
I am using a JQuery buttonset and am setting the icon, when hovered over or when active, to a colored version of the icon so it stands out. 我正在使用JQuery按钮集,并将图标悬停或处于活动状态时将其设置为图标的彩色版本,以使其突出。 The css looks like:
CSS看起来像:
.ui-button .ui-icon.line {
background-image: url("/static/16x16/line-black.gif");
}
.ui-button.ui-state-hover .ui-icon.line {
background-image: url("/static/16x16/line-color.gif");
}
.ui-button.ui-state-active .ui-icon.line {
background-image: url("/static/16x16/line-color.gif");
}
The above css works fine. 上面的css工作正常。 My question is whether there is a way to combine the 2nd and 3rd css rules.
我的问题是是否有一种方法可以结合第二和第三css规则。
I have tried, among other variations, this: 除其他变体外,我尝试了以下方法:
.ui-button .ui-icon.line {
background-image: url("/static/16x16/line-black.gif");
}
.ui-button.ui-state-hover .ui-button.ui-state-active .ui-icon.line {
background-image: url("/static/16x16/line-color.gif");
}
But I haven't found a combination that works. 但是我还没有找到一种可行的组合。
Is there a way to combine the two combinations (.ui-button.ui-state-hover and .ui-button.ui-state-active) in one css selector? 有没有办法在一个CSS选择器中组合这两种组合(.ui-button.ui-state-hover和.ui-button.ui-state-active)?
You can separate multiple selectors with a comma: 您可以使用逗号分隔多个选择器:
.ui-button.ui-state-hover .ui-icon.line, .ui-button.ui-state-active .ui-icon.line {
background-image: url("/static/16x16/line-color.gif");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.