我有一个 asp.net ImageButton,周围有不需要的边框。 BorderStyle 已设置为无。我也试过 Border-Width:0 但没有成功。我偶然发现了这个链接:
显然这也无济于事。有人可以帮忙吗。谢谢。
<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/