Reputation: 63718
How can you make a <a>
tag use the text-overflow: ellipsis
property? I have long link names that I would like to truncate.
Here is my attempt using the usual text-overflow approach.
Upvotes: 19
Views: 31599
Reputation: 3569
You'll need to change it to display: block;
or something else like inline-block
and specify a width, e.g:
a {
width: 50px;
display: block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
Upvotes: 54