@Ajax.ActionLink(" ","Delete", "FinancialIntermediary",
new { id = item.FinancialIntermediaryID },
new AjaxOptions { HttpMethod = "GET",
OnSuccess = "DeleteSuccessFI",
Confirm = "are you sure to perform the deletion." },
new { @class="classname" })
css文件是
.classname
{
background-image:url('../../Images/delete.png');
}
我使用上面的代码设置删除背景图片。
通过这样做,我无法避免文本。就像这样
我只想在那个地方拍照。请帮忙
答案 0 :(得分:2)
而不是使用
只需使用空格:
@Ajax.ActionLink(" ","Delete", "FinancialIntermediary", new { id = item.FinancialIntermediaryID }, new AjaxOptions { HttpMethod = "GET", OnSuccess = "DeleteSuccessFI", Confirm = "are you sure to perform the deletion." },new { @class="classname" })
您还需要为元素留出一些空间,以便显示背景图像:
.classname
{
background-image:url('../../Images/delete.png');
display: inline-block;
width: 20px; /* adjust as necessary */
height: 10px;/* adjust as necessary */
}