<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scal ...
<!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 {
display: box;
display: -webkit-box;
box-orient: vertical;
-webkit-box-orient: vertical;
line-clamp: 2;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<p id="test">多行文字限制顯示多行文字限制顯示多行文字限制顯示多行文字限制顯示多行文字限制顯示多行文字限制顯示多行文字限制顯示多行文字限制顯示</p>
</body>
</html>