line-clamp-010.html (737B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: when clamping by lines, lines after clamp are hidden even when they don't overflow</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/line-clamp-010-ref.html"> 7 <meta name="assert" content="When line-clamp is used with a number of lines, it should hide all lines after that number, even if they fit in the box height."> 8 <style> 9 .clamp { 10 line-clamp: 2; 11 font: 16px / 32px serif; 12 height: 4lh; 13 padding: 0 4px; 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>