CSS ellipsis with inline elements?

馋奶兔 提交于 2019-12-04 00:58:23

There is a display option that works as a half-way house between inline and block, designed for exactly this kind of situation...

it's called

display:inline-block;

Use this instead of block, and your element will still flow in your content as if it were inline, but will act as a block for its contents, which means your ellipsis should work.

You cannot apply text-overflow to inline elements.

http://dev.w3.org/csswg/css-ui/#text-overflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!