There's a problem while trying to see the project I have when using Internet Explorer 8 (how not?)
The thing is that the image and span, which can be both inline or block with floats, makes always be one below the other, or part of the text.
My example code is:
HTML
<div>
<div class="text-left">
<img src="my_image_path.png"><span>Some text at it's side</span>
</div>
<div class="text-right">
<span>Text to the right</span>
</div>
</div>
CSS:
.text-left {
float: left;
}
.text-left img {
margin-right: 10px;
}
.text-right {
float: right;
}
That code above works perfect in IE9, Safari, Chrome, Firefox... But not in IE8. The image is placed well, but the span doesn't stays in one line (not a very long text). As said above, I've tried with both being block
with float
left, but doesn't work either. The div container is with an auto
width.
Edit: the only way, and not very proud of it, to solve it I found by myself, it's adding minimum width to the div container of the image and span. Hope it's another way more accurate.
Edit 2: here I show you the result in IE8 and Chrome.
Result in IE8:
Result in Chrome (good):