text-overflow属性用于指定当文本溢出包含它的元素时,应该发生的事情。

CSS3 text-overflow属性
作用:text-overflow 属性规定当文本溢出包含元素时发生的事情。
语法:
text-overflow: clip|ellipsis|string;
clip:修剪文本。
ellipsis:显示省略符号来代表被修剪的文本。
string:使用给定的字符串来代表被修剪的文本。
注:所有主流浏览器都支持 text-overflow 属性。
CSS3 text-overflow属性的使用示例
div.test{white-space:nowrap; width:12em; overflow:hidden; border:1px solid #000000;}div.test:hover{text-overflow:inherit;overflow:visible;}将鼠标移动到框内,查看效果.
This is some long text that will not fit in the box
This is some long text that will not fit in the box
效果图:

本文参考:https://www.html.cn/book/css/properties/user-interface/text-overflow.htm
以上就是text-overflow属性怎么用的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1614194.html
微信扫一扫
支付宝扫一扫