want to add an image to a html type input button

Discussion in 'ASP .Net' started by Valli, Sep 26, 2007.

  1. Valli

    Valli Guest

    Hi,

    I want to add an image to a html type input button. How can I do this?
    I have used background image style . But its not working.

    My target is to show an image in the button
    can anyone help me?

    --
    Regards
    Valli
     
    Valli, Sep 26, 2007
    #1
    1. Advertising

  2. On Sep 26, 6:18 pm, "Valli" <> wrote:
    > Hi,
    >
    > I want to add an image to a html type input button. How can I do this?
    > I have used background image style . But its not working.
    >
    > My target is to show an image in the button
    > can anyone help me?
    >
    > --
    > Regards
    > Valli


    Hi Valli

    You're on the right track, you also need to set the background color
    to transparent:
    background-color: transparent;

    Or you can do it all in one go:
    background: transparent url(ButtonImage.gif) no-repeat center top;

    Chris
     
    Chris Fulstow, Sep 26, 2007
    #2
    1. Advertising

  3. On Sep 26, 10:18 am, "Valli" <> wrote:
    > Hi,
    >
    > I want to add an image to a html type input button. How can I do this?
    > I have used background image style . But its not working.
    >
    > My target is to show an image in the button
    > can anyone help me?
    >
    > --
    > Regards
    > Valli


    <input type="button" value="Button"
    style="background-image: url('http://msdn2.microsoft.com/msdn/controls/
    toolbar/en-us/StarWhite.gif');">
     
    Alexey Smirnov, Sep 26, 2007
    #3
  4. Valli

    Valli Guest

    Hi,

    Thanks for your help. Using background color style, the image is getting
    displayed in button now.
    I am using this button in a html table cell. When user clicks on this
    button, i will get the rowindex of the selected row.
    If I use this style, the rowindex is not resulting properly.

    Do you have any ideas on this?

    --
    Regards
    Valli

    "Chris Fulstow" <> wrote in message
    news:...
    > On Sep 26, 6:18 pm, "Valli" <> wrote:
    >> Hi,
    >>
    >> I want to add an image to a html type input button. How can I do this?
    >> I have used background image style . But its not working.
    >>
    >> My target is to show an image in the button
    >> can anyone help me?
    >>
    >> --
    >> Regards
    >> Valli

    >
    > Hi Valli
    >
    > You're on the right track, you also need to set the background color
    > to transparent:
    > background-color: transparent;
    >
    > Or you can do it all in one go:
    > background: transparent url(ButtonImage.gif) no-repeat center top;
    >
    > Chris
    >
     
    Valli, Sep 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam
    Replies:
    1
    Views:
    1,187
    Brian Kenneth Nielsen
    Nov 25, 2008
  2. Roberto
    Replies:
    3
    Views:
    327
  3. Replies:
    3
    Views:
    182
  4. Ron Brennan
    Replies:
    5
    Views:
    328
    Dr John Stockton
    May 14, 2004
  5. fochie
    Replies:
    0
    Views:
    333
    fochie
    Feb 1, 2005
Loading...

Share This Page