line-clamp-016.html (757B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp with -webkit-box and -webkit-box-orient</title> 4 <link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp"> 6 <link rel="match" href="reference/webkit-line-clamp-005-ref.html"> 7 <meta name="assert" content="If display: -webkit-box and -webkit-box-orient: vertical are present on the same box as line-clamp, line-clamp applies to that box."> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 line-clamp: 4; 13 font: 16px / 32px serif; 14 white-space: pre; 15 padding: 0 4px; 16 background-color: yellow; 17 } 18 </style> 19 <div class="clamp">Line 1 20 Line 2 21 Line 3 22 Line 4 23 Line 5</div>