line-clamp-002.html (627B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp with fewer lines than specified</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-001-ref.html"> 7 <meta name="assert" content="line-clamp should not have an effect on an element with fewer lines than specified."> 8 <style> 9 .clamp { 10 line-clamp: 6; 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>