在 ExtJS 中更改按钮文本颜色

change button text color in ExtJS

我需要更改按钮的文本颜色。我定义了一个css class like;

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

按钮定义在这里;

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

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

生成一个button,里面有span个元素。 color 需要在 span 而不是 button 中更改。这样做:

.mbutton span{
    color:red;
}