【问题标题】:asp.net + ImageButton with unwanted borderasp.net + ImageButton 带有不需要的边框
【发布时间】:2013-01-25 12:50:02
【问题描述】:

我有一个 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{border:0}?

标签: asp.net css


【解决方案1】:

这应该可以解决问题:

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

【讨论】:

    【解决方案2】:

    我猜这个问题是由于没有设置 ImageUrl。我其实是用 CSS 来设置背景的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多