Home  >  Article  >  Web Front-end  >  HTML超出文本显示省略号...通过text-overflow实现_HTML/Xhtml_网页制作

HTML超出文本显示省略号...通过text-overflow实现_HTML/Xhtml_网页制作

WBOY
WBOYOriginal
2016-05-16 16:39:471873browse

需要对div或者span同时应用Css:

复制代码
代码如下:

text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;

即可实现所想要得到的溢出文本显示省略号效果。
当然了你的页面元素要设置固定的宽度,超出了宽度才会显示。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn