html - 图标 .ico 扩展名在 IE 或 Chrome 中不显示

标签 html css internet-explorer google-chrome firefox

我有用于添加和删除的 gridview 按钮,我使用 css 为每个按钮显示图标。它在 firefox 中运行良好,但图标未显示在 IE 或 Chrome 中,这是我的 css 代码

.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>

最佳答案

代替 display: inline;,尝试使用 display: inline-block; 请记住,您不能将高度设置为 inline元素。

关于html - 图标 .ico 扩展名在 IE 或 Chrome 中不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23262228/

相关文章:

jquery - 我如何使用 jquery 为切换 div 设置 cookie

html - 使按钮响应并水平居中

javascript - 在 Internet Explorer 中禁用长时间运行的脚本消息

html - 显示 : flex not working in CSS

javascript - &lt;script&gt; src 没有在浏览器中读取正确的路径名

html - 如何从多个类别中选择第 n 个类型?

xml - 快速查看大型 XML 文件的应用程序?

html - 在 IE6 中,显示 : inline-block, 表,表行的替代方法是什么。表格单元格?

javascript - 添加位置 :sticky to element causes jumpy behaviour on scroll

javascript - Ajax 页面完全加载然后更新 DIV