asp.net + 带有不需要的边框的 ImageButton

标签 asp.net css

我有一个 asp.net ImageButton,周围有不需要的边框。 BorderStyle 已设置为无。我也试过 Border-Width:0 但没有成功。我偶然发现了这个链接:

http://weblogs.asp.net/reganschroder/archive/2008/01/22/remove-border-width-0px-from-asp-image-or-asp-imagebutton.aspx

显然这也无济于事。有人可以帮忙吗。谢谢。

<div class="squareButtonFrame "><asp:ImageButton ID="imgDelete" runat="server" CssClass="imgButtonImg imgDelete" BorderStyle="none" CommandName="Delete"/></div>

.squareButtonFrame /* This is the square frame which already has a border */
{
    margin-top: 3px;
    padding-bottom: 3px;
    display:inline-block; 
    height:32px; 
    width:35px; 
    border: thin solid #E1E1E1; 
    background-color: #FCFCFC;
    text-align:center;
    cursor:pointer
}

.imgButtonImg 
{
    margin: 0; 
    padding: 0;
    display:inline-block;
    height: 35px;
    width: 35px;
 } 

.imgDelete 
{
  background: url('/Images/Delete.png')  no-repeat center center;
}

最佳答案

这应该是一个技巧:

.imgButtonImg 
{
    margin: 0; 
    padding: 0;
    display:inline-block;
    height: 35px;
    width: 35px;
    border: 0; // note this line
 } 

关于asp.net + 带有不需要的边框的 ImageButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14522165/

相关文章:

jquery - 如何使用jquery隐藏asp.net中的gridview行?

c# - ASP :textbox select all text by click button and copy to client clipboard

需要 C# 字边界正则表达式而不是 .Contains()

html - 悬停时如何同时更改 svg 和文本的颜色?

css - 我是否必须使用 Compass 来使用 Django-Grappelli 修改 CSS?

javascript - 如何将 bootstrap 3 面板引入 bootstrap 2 网站?

javascript - Angular 行如果值改变

asp.net - 在 ASP.NET 中的开发/UAT/产品环境之间切换配置的最佳方法?

c# - 使用脚本管理器显示弹出窗口

html - 居中一个 float 的 div css 级联