如何在extjs按钮中居中图标?

时间:2012-07-17 13:33:17

标签: html css extjs

我有一个简单的按钮,但我不能让图标居中于它。

{
    xtype: 'button',
    width: 150,
    height: 150,
    cls: 'startbutton'
}

的CSS:

.startbutton { 
    background-image: url(Camera.png) !important;
}

此图片为72x72像素。

2 个答案:

答案 0 :(得分:4)

我想,你需要background-position

.startbutton { 
    background-position: center center;
    background-image: url(Camera.png) !important;
}

答案 1 :(得分:1)

您是否有理由不使用标准物品:

icon: '',
iconAlign: 'center'