本文介绍了跨度/背景图像IE6错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我的跨度包含两个单词。例如。 < span> Avant Garde< / span> 使用CSS,我将文本填充到右侧并指定背景-图片。例如。 span { padding:0 3px 0 11px; background:url(images / tagbull.gif)no -repeat 0px 2px; } 标签按预期呈现...除非行包裹在 $ b $的中间b两个字。然后背景图像不会出现在IE6中,但它在Firefox中渲染得很好。这是一个浏览器错误吗? 要查看示例,请使用IE6浏览以下URL并展开10 标签链接:< http://arty.me.uk/2006/01/04/announcing-avantist/> - Walker arty.me.uk 解决方案 我认为你应该尝试标记它看清单是列表。 无论如何,背景图像和内联元素并不总能很好地发挥作用。 logic_earth写道: 我认为您应该尝试将其标记为列表因为看到它是一个列表。无论如何,背景图像和内联元素并不总是很好。 在IE6中不能很好玩或者目前的浏览器一般?代码是 有效,结果应该是显而易见的,Konqueror,Opera和Firefox 都按预期呈现它。 :) (我在使用无序列表解决方案之前永远玩弄 选择跨度选项,但我有一些困难,我不能回想起来。 无论如何我会再次想到这个想法。) - 沃克 arty.me.uk 我不确定这是一个错误,但这是一个区别,是的。 问题是,当你为背景图像的水平 位置声明''left''或''0px'时,IE假定整个 span。当跨度划分超过2行时, 整个跨度的左侧位于第二行的左侧。当你没有看到从顶部设置它2px。 解决方法可能是两个跨度: < span>< span> < / span>一些单词< / span> 跨度{ 填充:0 3px 0 11px; 背景:url(images / tagbull.gif)no-repeat 0px 2px; } - Els http://locusmeus.com/ Sonhos vem。 Sonhos v?£。 O resto ?? crisfeito。 - Renato Russo - 现在玩:Magnum - 走直线 I have a span containing two words. Eg.<span>Avant Garde</span>Using CSS, I pad the text to the right and assign a background-image. Eg.span {padding: 0 3px 0 11px;background: url(images/tagbull.gif) no-repeat 0px 2px;}The tag renders as expected...unless the line wraps in the middle of thetwo words. Then the background-image doesn''t appear in IE6, but itrenders fine in Firefox. Is this a browser bug?To see an example, browse the following URL with IE6 and expand the "10Tags" link: <http://arty.me.uk/2006/01/04/announcing-avantist/>--Walkerarty.me.uk 解决方案I think you should try and mark it up as a list as seeing it is a list.Anyways backgound images and inline elements don''t always play well. I think you should try and mark it up as a list as seeing it is a list. Anyways backgound images and inline elements don''t always play well.Don''t play well in IE6 or current browsers in general? The code isvalid, the outcome should be obvious, and Konqueror, Opera and Firefoxall render it as expected. :)(I was playing around forever with an unordered list solution beforechoosing the span option, but I had some difficult that I can''t recall.I''ll have a play around with the idea again anyway.)--Walkerarty.me.ukI''m not sure it''s a bug, but it is a difference, yes.The thing is, that when you state ''left'' or ''0px'' for the horizontalposition of the background-image, IE assumes ''left'' of the entirespan. When the span is divided over 2 lines, the left side of thewhole span, is on the left of the second line. Out of sight when youset it 2px from the top.A workaround might be to have two spans:<span><span> </span>some words</span>span span {padding: 0 3px 0 11px;background: url(images/tagbull.gif) no-repeat 0px 2px;}--Els http://locusmeus.com/Sonhos vem. Sonhos v?£o. O resto ?? imperfeito.- Renato Russo -Now playing: Magnum - Walking The Straight Line 这篇关于跨度/背景图像IE6错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-02 09:45