Reputation: 297
I'm trying to create a link in my page that is formed by a text followed by a font-awesome icon. This link can not bypass a given width, so I created I css class to truncate the text if necessary. Also the icon need to be aligned to the right (I'm using float:right
).
This is the fiddle with the example of what I'm trying to do:
and here is the code:
<div class="divclass truncate">
<a href="www.google.com" title="blablablablabla">
<i class="fa fa-fw fa-lg fa-lock" style="float:right;" title="Read only"></i>
blablablablablablablablabla
</a>
</div>
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.divclass {
width: 100px;
}
This works fine on Chrome, but on Firefox the icon is overlapping the text.
Anyone knows how to fix this?
Upvotes: 3
Views: 1270
Reputation: 96306
I’d probably approach this in a slightly different way:
width
and text-overflow
to the link itselfhttp://jsfiddle.net/czf552vp/7/
Upvotes: 3