line-clamp-011.html (795B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: when clamping by lines, if the height doesn't fit that number of lines, the clamp point depends on the height instead</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-011-ref.html"> 7 <meta name="assert" content="When line-clamp is used with a number of lines while also having a set block size, whichever comes earlier takes precedence."> 8 <style> 9 .clamp { 10 line-clamp: 4; 11 font: 16px / 32px serif; 12 height: 3lh; 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> 23 <p>Following content.</p>