<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <title>css实现多行文字限制显示</title> <style> #test {
width:200px; display: box; display: -webkit-box; box-orient: vertical; -webkit-box-orient: vertical; line-clamp: ; -webkit-line-clamp: ; overflow: hidden; text-overflow: ellipsis; } </style> </head> <body> <p id="test">多行文字限制显示多行文字限制显示多行文字限制显示多行文字限制显示多行文字限制显示多行文字限制显示多行文字限制显示多行文字限制显示</p> </body> </html>