[CLOSED] How to assign Image to button through CSS

  1. #1

    [CLOSED] How to assign Image to button through CSS

    Hi,
    How can I assign image to button through CSS

                    <ext:Button ID="btnSave" runat="server" Text="Save" AutoPostBack="true"   Width="70px" Height="18px"/>
    Last edited by Daniil; Dec 13, 2010 at 12:40 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use .IconCls property.
    http://dev.sencha.com/deploy/dev/doc...member=iconCls
  3. #3

    Hi

    /* Css for image */
    .btnCommonImage
    {
        background-image:url(Images/save_25.jpg) !important;    
        background-repeat:no-repeat;
        background-position:center;   
        width:70px;
        height:18px;
    }
    
    /* Button Code*/
                    <ext:Button ID="btnCancel" runat="server" Text="Cancel" PostBackUrl="ItemList.aspx"
                        AutoPostBack="true" Width="70px" Height="18px" IconCls="btnCommonImage" />
    I attached the image of how its displaying when im using IconCls. Actually I need it to be display like button. Can you let me know how to place the image perfectly.
    Attached Thumbnails Click image for larger version. 

Name:	Buttons.jpg 
Views:	64 
Size:	2.8 KB 
ID:	2020  
  4. #4
    Hi,

    It's a not trivial task to change background of common Button.

    I would suggest you to use <ext:ImageButton>
    https://examples1.ext.net/#/Buttons/Basic/ImageButton/

Similar Threads

  1. [CLOSED] Bakcground image for button
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 08, 2012, 6:58 AM
  2. [CLOSED] Image and text in button
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 17, 2009, 8:51 AM
  3. [CLOSED] Image next to radio button?
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 06, 2009, 11:31 AM
  4. Image Button
    By sz_146 in forum 1.x Help
    Replies: 0
    Last Post: Oct 23, 2008, 7:54 AM

Posting Permissions