webkit-line-clamp-040.html (654B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp with explicit height</title> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="author" title="Mozilla" href="https://mozilla.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp"> 7 <link rel="match" href="reference/webkit-line-clamp-040-ref.html"> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 -webkit-line-clamp: 2; 13 font: 16px / 32px serif; 14 white-space: pre; 15 background-color: yellow; 16 height: 5em; 17 } 18 </style> 19 <div class="clamp">Line 1 20 Line 2 21 Line 3 22 Line 4 23 Line 5</div>