1

不要な境界線が周囲にあるasp.net ImageButtonがあります。BorderStyle は既に none に設定されています。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;
}
4

2 に答える 2

1

これはトリックを行うはずです:

.imgButtonImg 
{
    margin: 0; 
    padding: 0;
    display:inline-block;
    height: 35px;
    width: 35px;
    border: 0; // note this line
 } 
于 2013-01-25T13:35:25.063 に答える
0

問題は ImageUrl を設定していないことが原因だと思います。私は実際にCSSを使用して背景を設定しています。

于 2013-01-25T14:24:28.397 に答える