1. 程式人生 > >Extjs之icon和iconCls的圖解寫法,通俗易懂

Extjs之icon和iconCls的圖解寫法,通俗易懂

icon:在文字下面的背景圖。直接寫路徑即可。

效果圖:

程式碼如下:

  {
              text:'btn1',
              xtype:'button',
              //iconCls: 'bik',
              icon:'css/feed_add.png'  直接指定路徑即可
 } 

iconCls:與文字一起的左邊的圖片。要關聯css樣式表的class屬性

效果圖:

{
              text:'btn1',
              xtype:'button',
              iconCls: 'bik'   指定css樣式表
 },

Css樣式表寫法:

.bik{
  background-image: url(feed_add.png)!important;
}