css超过两行显示省略号
时间: 2023-10-13 20:00:19 浏览: 203
要实现CSS超过两行显示省略号,可以使用CSS3的属性。你可以将元素的宽度设置为固定值,然后使用`overflow: hidden;`来隐藏超出的文本。接下来,使用`text-overflow: ellipsis;`来显示省略号。最后,利用弹性盒模型的属性可以指定显示的行数,例如使用`display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;`来指定显示4行。这样就可以实现超过两行显示省略号的效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [CSS文本设置超出2行显示省略号](https://blog.csdn.net/weixin_44582045/article/details/125203749)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [CSS文本超过2行省略号(...)显示](https://blog.csdn.net/guozhangqiang/article/details/102581681)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文