Hide the text beyond two lines and show the ellipsis code as follows:
{
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
/* Autoprefixer: off */ If you find that two lines of text are displayed but no ellipsis is shown, add the following code:
/* autoprefixer: off */
{
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
Read More:
- CSS to achieve dynamic display of picture text by mouse touch
- [Solved] Error: #error More than 1 blank line not allowed no-multiple-empty-lines
- Vue JS import font.css error [How to Solve]
- show dbs Error: [js] uncaught exception: Error: listDatabases failed
- WPF: How to implement Text Stroke
- [Solved] Vue Import swiper.css Error: Module not found…
- How to Use DOM to operate CSS
- Such a simple serialization system.text.json.serialization also reports an error?
- [Solved] Syntax Error: Error: PostCSS received undefined instead of CSS string
- Syntax Error: Error: PostCSS received undefined instead of CSS string
- [Solved] Layui 404 Error: Static resources cannot load layui.js and layui. css
- Vue Import element-plus Error: Failed to resolve import “element-pluslibtheme-chalkindex.css“ from “src
- [Solved] Failed to load config “prettier“ to extend from.?
- [Solved] Uniapp project use vant icon Error: (module build failed from./node_modules/postcss loader/SRC/index)
- Vue: How to Fix “not displaying the holder in IE9 and below”
- [Solved] error Component name “xxx“ should always be multi-word vue/multi-word-comp
- JavaScript determines whether parentheses are paired.
- [Solved] Error: postcss plugin autoprefixer requires postcss 8 error report problem repair
- H5 page left and right stretch content area
- Difference between innerHTML and innerText