Home >Web Front-end >CSS Tutorial >Use CSS to automatically truncate text without using a program and replace it with ellipses_Experience exchange

Use CSS to automatically truncate text without using a program and replace it with ellipses_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:06:441666browse

.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*/
}


[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]
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