webkit-line-clamp-004.html (727B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: -webkit-line-clamp with exactly as many lines as specified</title> 4 <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp"> 6 <link rel="match" href="reference/webkit-line-clamp-001-ref.html"> 7 <meta name="assert" content="-webkit-line-clamp should not have an effect on an element with exactly as many lines as specified."> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 -webkit-line-clamp: 5; 13 font: 16px / 32px serif; 14 white-space: pre; 15 background-color: yellow; 16 } 17 </style> 18 <div class="clamp">Line 1 19 Line 2 20 Line 3 21 Line 4 22 Line 5</div>