Greg Lafrance
Greg Lafrance

Reputation: 809

Why does my ExtJS 4.2 Label text not change color, though I have a cls applied?

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'
}

Upvotes: 0

Views: 1710

Answers (1)

Lorenz Meyer
Lorenz Meyer

Reputation: 19895

Look at the label in Google dev tool. Probably your css gets overridden because there is a more specific rule. You have to add something to your css selector like

.x-label .myTextClass {
    color: #ff0000;
}​

Upvotes: 2

Related Questions