This question has been here for a while, but I found a good answer, so I want to share it.
According to this answer , which I found elsewhere in StackOverflow, the elements that you want to have correctly must first be specified in your html structure.
<div class="my-fixed-width under-review data-sent-false"> <span class="glyphicon glyphicon-asterisk" style="color:blue"></span> <span class="glyphicon glyphicon-pause" style="color:darkgray"></span> <a href="myobjectview/789/" style="inline-block;">C4U0UACXX-8 6nb</a> </div>
This error gave me all kinds of problems on my own website, but as soon as I found out about it, I realized that it is actually quite simple to understand the fix. When you put float: the right element after everything else, then it will float right just like you requested. But if there is not enough space to the right (or if some browser quirk makes it a reason for not enough space), then this element will also be pushed away, so the browser is satisfied that it will do. But if you put float: right element first, then it will go where it should before the browser selects any other elements. Then, those who do not have a float: are inserted correctly according to their usual layout, including setting an automatic width or an automatic field to accommodate floating elements.
This did not happen when I tested this, but this configuration can still lead to both of them being on top of each other, even if they are not initially shifted from the starting position, but if that happens try adding a display: built-in unit in the following way:
span.glyphicon{ float:right; display:inline-block; }
See this JSFiddle for an example of how it works with gaps placed in front of the anchor.
source share