html - IE6 : span (inline) with background-image

标签 html css internet-explorer-6

我正在尝试找到显示我的图标的好理由。

我想使用 CSS 而不是 img 选项卡。

我的代码:

<span id="Span1" class="iconPrinter"></span>

.iconPrinter{背景:url(../images/BWIcons.gif) 不重复 0 0;内边距:0 8px;}

.iconPrinter{背景:url(../images/BWIcons.gif) 不重复 0 0;宽度:16px;}

它在 FF 上工作正常,但在 IE6 上我看不到图标,除非我在跨度中插入一个跨度。

当我使用 div 或 display:block; 时它工作正常,但我需要它是内联的。

谢谢

最佳答案

我发现插入内联标记(例如适用于 IE6 的 span)的最简单方法是:

(对于 16 像素图标)

<span id="Span1" class="iconPrinter">&nbsp;</span>

.iconPrinter{background:url(../images/BWIcons.gif) no-repeat 0 0; padding:0 7px; font-size:16px;}

关于html - IE6 : span (inline) with background-image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1377642/

相关文章:

html - 在浏览器中捕获媒体键事件

html - 单元格中的内容对于 pdf 页面而言太长 (NetSuite)

javascript - 如何将 1-3 张图像打印到单个输出页面上?

html - IE6显示错误的背景图片

html - 媒体查询 - 通用响应模板

html - CSS 我的 <TD> 和 <TH> 的边界不相交

javascript - 使用 JavaScript 检测非 http 重定向

html - 如何将 div 包裹在不均匀的内容周围

html - 右侧列在 IE6/7/8 中未正确对齐

html - CSS:IE6 和多个 div 并排出现问题,元素在右浮动