所选行的背景色 [英] Selected row background color
问题描述
我正在将jqgrid与jquery-ui'smoothness'主题一起使用,不幸的是,使用此主题时,所选行的背景颜色太浅,我试图更改背景颜色以使其更加可见.我试图在css中更改ui-state-highlight(使用!important覆盖),但这不起作用.有没有CSS的方法可以做到这一点,或者jqgrid自定义格式化程序是可行的方法?
I'm using jqgrid with jquery-ui 'smoothness' theme, unfortunately with this theme the selected row background color is too light, I'm trying to change the background color to make it more visible. I've tried changing ui-state-highlight in css (with !important override) but this does not work. Is there a CSS way to do this or perhaps a jqgrid custom formatter is the way to go?
推荐答案
类ui-state-highlight
使用background
CSS属性.因此,一个小技巧是使用background
而不是background-color
删除背景图像.例如
The class ui-state-highlight
uses the background
CSS attribute. So a small trick is to use background
instead of background-color
to remove the background image. For example
.ui-state-highlight { background: yellow !important; }
请在
已更新:没有必要使用!important
.指定一个更具体的规则(如
UPDATED: It's not necessary to use !important
. It's enough to specify a more specific rule like
.ui-jqgrid-btable .ui-state-highlight { background: yellow; }
或
.ui-jqgrid .ui-state-highlight { background: yellow; }
这篇关于所选行的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!