<分区>
是否可以在纯 css 中删除或简单地隐藏字符串中的最后一个字符?
当我搜索这个时,我只找到了 javascript/jQuery 解决方案。
提前谢谢你。
标签 css
<分区>
是否可以在纯 css 中删除或简单地隐藏字符串中的最后一个字符?
当我搜索这个时,我只找到了 javascript/jQuery 解决方案。
提前谢谢你。
最佳答案
使用 CSS3 text-overflow
。
( More information about text-overflow
)
CSS:
#txt{
position:relative;
padding:7px;
text-align:justify;
background:#e7e7e7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
工作于:(最新版本)
关于css - 使用纯 css 隐藏字符串中的最后一个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24150580/