change button text color in ExtJS

4.4k views Asked by At

I need to change text color of my button. I defined a css class like;

.mbutton{
    background:transparent;
    color:red;
    border:none;
}

and button definition is here;

Ext.create('Ext.Button', {
            renderTo: Ext.getBody(),
            text: 'Red text',
            cls:'mbutton'
   });

fiddle: https://fiddle.sencha.com/#fiddle/olj

1

There are 1 answers

0
lmgonzalves On BEST ANSWER

A button is generated with span elements inside. The color need to be changed in span instead in button. Do this way:

.mbutton span{
    color:red;
}