开发者

CSS Styles not applying to ExtJS Button

开发者 https://www.devze.com 2023-03-31 12:11 出处:网络
I have added css styles to my buttons which are nested within a panel. However, the buttons are not appearing as transparent even if I put the !important tag in the css.

I have added css styles to my buttons which are nested within a panel. However, the buttons are not appearing as transparent even if I put the !important tag in the css.

I have also tried adding addStyles/cls: tags to the button object but that hasn't worked either.

Does anyone know why this might be?

Button Code:

var button = new Ext.Button({
                text: month,    
                //cls: "test",
                handler: function(button){
                    var buttonMonth = button.text;
                    getGrids(buttonMonth);
                }
            });
            //button.addClass("test");
            panel.add(button);  

CSS Class:

.x-btn{
    font:normal 11px tahoma, verdana, helvetica;
    cursor:pointer;
    white开发者_如何学Python-space: nowrap;
}

.x-btn button {
    border:0 none;
    background:transparent !important;
    font:normal 11px tahoma,verdana,helvetica;
    padding-left:3px;
    padding-right:3px;
    cursor:pointer;
    margin:0;
    overflow:visible;
    width:auto;
    -moz-outline:0 none;
 }


Buttons's backgound is set by using background-image in tds. This should work (here is demo):
JS:

var button = new Ext.Button({
    text: month,    
    cls: "test",
    // ...
});

CSS:

.test td {
    background-position: 1000px 1000px;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消