简体   繁体   中英

change button text color in ExtJS

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM