Home >Web Front-end >CSS Tutorial >Use CSS to automatically truncate text without using a program and replace it with ellipses_Experience exchange
.test{
width:200px;
height:50px;
border:1px solid red;
padding:10px;
overflow:hidden; /*Do not display content that exceeds the width of the object* /
text-overflow:ellipsis; /*Display an ellipsis mark (...) when the text in the object overflows*/
white-space:nowrap; /*Limit all text to be displayed in one line*/
}