zii.widgets.CDetailView - can't change background color

[size=2]Hi great Yii’ers![/size]

[size=2]

[/size]

[size=2]I am trying to modify the background color of the zii.widgets.CDetailView widget.[/size]

[size=2]

[/size]

[size=2]I notice that each row has a class "odd" or "even" and that the entire table is class "[/size][color=#1A1AA6][font=monospace][size=2]detail-view"[/size][/font][/color]

[color=#1A1AA6][font=monospace][size=2]

[/size][/font][/color]

[color=#1A1AA6][font=monospace][size=2]Now in my css I have:[/size][/font][/color]

[font="monospace"][color="#1A1AA6"][size=2].odd{ color:black; background-color: #9e9b9b; } .even{ color:black; background-color: #7a7a7a; } [/size][/color][/font]

[font="monospace"][color="#1A1AA6"][size=2]

[/size][/color][/font]

[font="monospace"][color="#1A1AA6"][size=2]this works for gridview but not this detail view[/size][/color][/font]

[font="monospace"][color="#1A1AA6"][size=2]

[/size][/color][/font]

[font="monospace"][color="#1A1AA6"][size=2]Also I tried defining [/size][/color][/font][color=#444444][font=Arial, Helvetica, sans-serif][size=2]itemCssClass[/size][size=2] in the widget params as so:[/size][/font][/color]

[color=#444444][font=Arial, Helvetica, sans-serif][size=2]‘itemCssClass’=>myClass[/size][/font][/color]

[font="Arial, Helvetica, sans-serif"][color="#444444"][size=2]and in my css, I did:[/size][/color][/font]

[font="Arial, Helvetica, sans-serif"][color="#444444"][size=2].myClass odd{[/size][/color][/font]

[font="Arial, Helvetica, sans-serif"][color="#444444"][size=2]background-color: red;[/size][/color][/font]

[font="Arial, Helvetica, sans-serif"][color="#444444"][size=2]}[/size][/color][/font]

[color=#444444][font=Arial, Helvetica, sans-serif][size=2]but again, this didnt work… anyone have any suggestions?[/size][/font][/color]

Try to set cssFile attribute to your cssfile and overide the classes there.

Also check if there’s another gridview on the same page that uses the default css and overides yours