PDA

View Full Version : Label cls is not applied, so text does not change color.



xjscrafter
12 Jul 2014, 8:53 AM
I have a label and I'm setting the text color like this, but the label text does not change color:


xtype: 'label',
text: 'My Text',
cls: 'myTextClass'


Here is the CSS:


.myTextClass {
color: #ff0000;
}?


If I do this on the label it works:



style: {
color: '#ff0000'
}

skirtle
12 Jul 2014, 11:11 AM
Works for me:

7l8

Diagnosing the problem should be very easy. Inspect the DOM and check that the CSS class is being added. If it is, inspect the styles to see whether your rule is being applied and whether any other rules are take higher priority.

xjscrafter
14 Jul 2014, 11:29 AM
Firebug tells me that label's color is being inherited from div#panel-1139-body.xpanel-body, and I see the color property listed under .x-panel-body-default.

I both of these but neither worked:


.afxPreferenceItemDescription .x-panel-body-default {
color: #777777;
}?

.x-panel-body-default .afxPreferenceItemDescription {
color: #777777;
}?

Sabareesh
15 Jul 2014, 2:59 AM
Have you tried changing the css to make it important so that it overrides other css

.mvLabelText {
color : #fffff !important;
}