CSS Styles not applying to ExtJS Button
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 td
s. This should work (here is demo):
JS:
var button = new Ext.Button({
text: month,
cls: "test",
// ...
});
CSS:
.test td {
background-position: 1000px 1000px;
}
精彩评论