我有文字和计数的列表,像这样有需要的内容合作:获取文本溢出:省略号后
+----------------------------+
| Some text (123) |
| Some other text (456,789) |
+----------------------------+
在我的UI,我约束的空间,所以我想拍确保计数符合分配的空间。要做到这一点,我用我的文字text-overflow: ellipsis;
,所以最好我想看到这一点:
+--------------------+
| Some text (123) |
| Some ot… (456,789) |
+--------------------+
但我的计数不中奖。它被推出盒子,就像这样:
+--------------------+
| Some text (123) |
| Some other t… (456,789)
+--------------------+
正如你所看到的,省略号逻辑仍然是射击,但...只是不舒服。 :-)
Here's a handy-dandy JSFiddle demonstrating the issue.