I'm trying to truncate text within the anchor text of an element. I added overflow: hidden; text-overflow: ellipsis;
in the style of my anchor tag, but it still wraps.这里有一些可以复现的HTML:
Test Test 123
Column A Column B Entry A
It doesn't seem to like the 50px width on the anchor tag text, I think it's the column width that's messing with it.
If you don’t want to wrap, you can add
white-space:nowrap
;If you want to set
width
, set it to50px
instead of50 px
(no spaces allowed);If you want
width
to take effect, set yourto a block-level element, e.g. using
display:inline-block
Here is the code: