I'm trying to do something very similar to the aligning text next to an image question: Vertically align text next to an image?
The difference is, I want the image to float to the right, but it seems when I make it float:right;
, the vertical-align
that solved that problem doesn't work anymore? Is there a way to have the img float to the right AND have the text still middle aligned to it?
<div style="width:100px">
<span style="vertical-align:middle">Doesn't work.</span>
<img style="vertical-align:middle;width:30px;height:30px;float:right">
</div>
Thanks in advance!