webkit-line-clamp-001.html (697B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: -webkit-line-clamp when not display:-webkit-box</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 apply to an element that is not a flex item for a legacy -webkit-box or -webkit-inline-box flex container."> 8 <style> 9 .clamp { 10 -webkit-line-clamp: 3; 11 font: 16px / 32px serif; 12 white-space: pre; 13 background-color: yellow; 14 } 15 </style> 16 <div class="clamp">Line 1 17 Line 2 18 Line 3 19 Line 4 20 Line 5</div>