webkit-line-clamp-005.html (816B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: -webkit-line-clamp with more lines than 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-005-ref.html"> 7 <meta name="assert" content="-webkit-line-clamp should clamp to the specified number of lines."> 8 <style> 9 .clamp { 10 display: -webkit-box; 11 -webkit-box-orient: vertical; 12 -webkit-line-clamp: 4; 13 font: 16px / 32px serif; 14 white-space: pre; 15 background-color: yellow; 16 padding: 0 4px; 17 overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ 18 } 19 </style> 20 <div class="clamp">Line 1 21 Line 2 22 Line 3 23 Line 4 24 Line 5</div>