0

I have an ASP.net button with an image. I am not nor do i want to use an Imagebutton. It is a standard asp.net button. Image loads perfect but:

  1. i would like the image to align vertically in the center of the button
  2. I would like the image to be 5 px from the left edge of the button

is this possible? thanks Damo

HTML

<asp:Button CssClass="Button" ID="btnLogin" runat="server" Text="Login" onclick="btnLogin_Click" />

CSS

.Button
{


         -moz-border-radius: 5px;
         -webkit-border-radius: 5px;
         -khtml-border-radius: 5px; 
          border-radius: 5px; 

          text-align:left;


          padding-left:20px;       
          background-repeat: no-repeat;
          background-image: url(/assets/img/action.gif);

}
1

1 Answer 1

1

This depends on the image size..

But here you get the code,

.button{
background: url(/assets/img/action.gif) no-repeat 5px 50%;
padding:5px 5px 5px 20px;
border-radius:5px;
text-align:left;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.