CSS:
div{
width:160px;
text-overflow:ellipsis;
overflow:hidden;
white-space:nowrap;
text-transform: uppercase;
}
I edited a fiddle created by someone else who meant to answer this question.
This solution works well, BUT in one case does not work correctly. If the text should be 100% of the box ellipsis, it is hiding the last few letters and adding "...". However, when you manipulate the CSS and remove the overflow statement, then the size fits.
So this way is not 100% reliable, but I need a 100% working one.
Does anyone have a proper solution?
text-overflow
and measure the height, and then use it and measure the height, and if it's the same height, then don't usetext-overflow
.