0

I have a asp:Button, I used css styles with cssClass property in asp:Button, but those styles are not working.

This is my asp button:

<tr>
    <td>
        <div class="form_row">
             <asp:Button ID="ButtonSend" CssClass="BtnSend" runat="server" Text="Send" OnClick="ButtonSend_Click" />
        </div>
    </td>
</tr>

This is my CSS:

.BtnSend {
  width: 53px;
  height: 24px;
  display: block;
  float: right;
  margin: 0 0 0 10px;
  background: url(../../Images/contact_bt.gif) no-repeat center;
  text-decoration: none;
  text-align: center;
  line-height: 24px;
  color: #fff;
}

If I'm not wrong, I should use something like this:

input[type="submit"]
{
 //css coding
}

but I don't know where to put it and how to affect only this button.

5
  • 1
    How does the buttons html look like when rendered in browser? Commented Mar 4, 2014 at 14:03
  • <input type="submit" ... value="Send"... class="BtnSend" /> here it is. Commented Mar 4, 2014 at 14:12
  • Use .BtnSend and add it in your css file. Commented Mar 4, 2014 at 14:15
  • Your css seems to be working fine. DEMO HERE. You'll see your button on the top right corner. That's what your css tells it to do. Commented Mar 4, 2014 at 14:16
  • Yes but the button still looks like a default button because the background: url(../../Images/contact_bt.gif) no-repeat center; is an image with rounded corners which is not showing them. It looks like an image inside a default button without rounded corners. Commented Mar 4, 2014 at 14:29

1 Answer 1

1

Based on your comment, add/change this in your css:

.BtnSend {
  border: none;
  background: transparent url(../../Images/contact_bt.gif) no-repeat center;
}
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.