在我的extjs項目中,我在網格標題內有一個菜單按鈕。我正在嘗試使字體適合按鈕的小區域。它看起來越大,我使文本越向下移動。我怎樣才能使它適合在按鈕內?extjs - 在較小的按鈕上正確放置按鈕內的字體文本
這裏是視圖
xtype: 'grid',
itemId: 'detailsGridID',
bind: {
store: '{myDetailsStore}'
},
header: {
items: [{
xtype: 'button',
text: 'Trades',
width: 100,
height: 15,
cls: 'buttonTopdayCSS',
menu: [{
text: 'Net',
handler: function() {
alert('click net');
}
}, {
text: 'Topday',
handler: function() {
alert('click topday');
}
}]
}]
這裏的CSS類
.buttonTopdayCSS {
background-color: #a7cfdf; background-image: -webkit-gradient(linear, left top, left bottom, from(#a7cfdf), to(#23538a));
background-image: -webkit-linear-gradient(top, #a7cfdf, #23538a);
background-image: -moz-linear-gradient(top, #a7cfdf, #23538a);
background-image: -ms-linear-gradient(top, #a7cfdf, #23538a);
background-image: -o-linear-gradient(top, #a7cfdf, #23538a);
background-image: linear-gradient(to bottom, #a7cfdf, #23538a);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#a7cfdf, endColorstr=#23538a);
}
.buttonTopdayCSS .x-btn-inner {
font-size: 10px !important;
}
你可以嘗試添加'padding:0; border:0;'to'.buttonTopdayCSS'。 – chrisuae
謝謝你...這工作!在CSS中添加填充和邊框 – solarissf