<style>
div {
/*
必须有宽度
强制文本在一行内显示 white-space: nowrap;
溢出内容为隐藏 overflow: hidden;
溢出文本显示省略号 text-overflow: ellipsis;
*/
width: 200px;
height: 200px;
background-color: red;
/* 溢出省略号显示 */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
文本溢出省略号显示
于 2022-05-22 23:00:45 首次发布