Html 图标。图标扩展不';t显示在IE或Chrome中
我有用于添加和删除的gridview按钮,我使用css为每个按钮显示图标。它在firefox中运行良好,但ICCON不会显示在IE或Chrome中。这是我的css代码Html 图标。图标扩展不';t显示在IE或Chrome中,html,css,internet-explorer,google-chrome,firefox,Html,Css,Internet Explorer,Google Chrome,Firefox,我有用于添加和删除的gridview按钮,我使用css为每个按钮显示图标。它在firefox中运行良好,但ICCON不会显示在IE或Chrome中。这是我的css代码 .delete { display: inline; background: url('delete.ico') no-repeat; border: none !important; background-position: -0px -0px; width: 20px; heig
.delete {
display: inline;
background: url('delete.ico') no-repeat;
border: none !important;
background-position: -0px -0px;
width: 20px;
height: 20px;
float: none;
}
.edit {
display: inline;
background: url('edit.ico') no-repeat;
border: none !important;
background-position: -0px -0px;
width: 20px;
height: 20px;
float: none;
}
[编辑]
这是html按钮
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="BtnDelete" runat="server" CssClass="delete" CommandName="Removal" OnCommand="BtnDelete_Command" CommandArgument='<%# DataBinder.Eval(Container,"RowIndex")+";"+Eval("code")+";"+Eval("name") %>' OnClientClick="return not_check1();" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="BtnEdit" runat="server" CommandName="Edit" Text="" CssClass="edit" OnCommand="BtnEdit_Command" CommandArgument='<%# DataBinder.Eval(Container,"RowIndex")+";"+Eval("code") %>' />
</ItemTemplate>
</asp:TemplateField>
而不是显示:内联,尝试使用显示:内联块请记住,不能将高度设置为内联元素 .ico仅作为favicon在所有浏览器中受支持。
请改用png、gif或jpg。
或者至少是回退版本:
.delete {
display: inline;
background: url('delete.png') no-repeat; /*fallback*/
background: url('delete.ico') no-repeat;
border: none !important;
background-position: -0px -0px;
width: 20px;
height: 20px;
float: none;
}
.edit {
display: inline;
background: url('edit.png') no-repeat; /* fallback */
background: url('edit.ico') no-repeat;
border: none !important;
background-position: -0px -0px;
width: 20px;
height: 20px;
float: none;
}
作为一种符号。你不需要放-0px-0px,你可以用0代替。你也可以显示一些html吗?