The problem here is that you are applying a background image to an inline element that has wrapped. In FF, the left edge of the left padding on the first line is seen as the 0 x coord of the background image. In IE, the left most portion of the wrapped line signifies this position. If you were to add an id to the second span:
Code:
<span class="value">hello</span>
<span class="value" id="two">se cond</span>
and this conditional stylesheet in the head:
Code:
<!--[if IE]>
<style type="text/css">
#two {
background-position: 62px -447px;
}
</style>
<![endif]-->
It would work out. Alternatively, you could forget about all that, and just make the value class display:block; That would make the alignment uniform, but also change the layout though:
Code:
.value {
padding:0px 0px 0px 24px;
color:#0080FF;
font-weight:bold;
cursor:pointer;
background: transparent url(images_sprites.gif) no-repeat scroll 4px -447px;
display:block;
}
If the container (main) was wide enough to prevent wrapping (as someone else hinted at already), that would also solve the problem.
Finally, although I haven't tested this yet (I will, and report back only if there are problems). I believe you could use 4 spans in place of the two:
HTML Code:
<span class="value"></span>
<span class="text">hello</span>
<span class="value"></span>
<span class="text">se cond</span>
apply the background image style only to the value spans, and apply whatever text styling you prefer to the text spans. The value spans would still need padding to be wide enough.
Bookmarks