line-clamp-auto-037.html (850B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: `line-clamp: auto` with non-zero max-height that doesn't fit any content</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-auto-011-ref.html"> 7 <meta name="assert" content="When line-clamp: auto is used with a max-height that isn't enough for any contained boxes or line boxes, then it should not show any content and its content box's intrinsic size should be zero"> 8 <style> 9 .clamp { 10 line-clamp: auto; 11 max-height: 0.5lh; 12 font: 16px / 32px serif; 13 white-space: pre; 14 background-color: yellow; 15 border: 1px solid black; 16 padding: 4px; 17 } 18 </style> 19 <div class="clamp">Line 1 20 Line 2 21 Line 3 22 Line 4</div> 23 <p>Following content.</p>